DSA_GENERATE_KEY(3SSL)

πŸ‘‘ DSA_GENERATE_KEY(3SSL) β€” bestie's guide to making a DSA key pair ✨

okay so you're in the OpenSSL section 3SSL of the manual and you want a shiny new DSA key pair. say less. let's go πŸ’…


🌸 NAME 🌸

DSA_generate_key β€” generate a DSA key pair πŸ”‘βœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <openssl/dsa.h>

so here's the tea, bestie: the following functions have been deprecated since OpenSSL 3.0 😭, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β€” check openssl_user_macros(7) for the deets.

int DSA_generate_key(DSA *a);

πŸ’– DESCRIPTION πŸ’–

okay so first thing first: all of the functions described on this page are deprecated, periodt. no cap. 🚫

Applications should instead use EVP_PKEY_keygen_init(3) and EVP_PKEY_keygen(3), as described in EVP_PKEY-DSA(7). that's the move now, iykyk ✨

DSA_generate_key() expects a to contain DSA parameters. it then generates a new key pair and stores it in a->pub_key and a->priv_key. so cute, so convenient πŸŽ€

the random generator must be seeded prior to calling DSA_generate_key(). non-negotiable fr fr.

🚨 and listen β€” if the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to external circumstances (see RAND(7)), the operation will fail. not "might". will. that's the vibe check and it did not pass πŸ’€

✨ RETURN VALUES ✨

DSA_generate_key() returns 1 on success πŸŽ‰, and 0 otherwise πŸ™ˆ.

the error codes can be obtained by ERR_get_error(3) β€” go read the receipts, bestie.


πŸ‘€ SEE ALSO πŸ‘€


πŸ•°οΈ HISTORY πŸ•°οΈ

this function was deprecated in OpenSSL 3.0. it's giving legacy. it's giving "we still love you but please use EVP now". 🫢


Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


okay that's the whole page, you ate that πŸ’… no thoughts, just keys. this was version 4.0.3, dated 2026-09-29 β€” mwah, see you in the next manpage bestie πŸ’–πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from