DSA_GENERATE_KEY(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… DSA_GENERATE_KEY πŸ’…

okay so bestie, welcome to DSA_GENERATE_KEY(3ossl) β€” this is one of those OpenSSL man pages, third section, ossl flavor. and listen… it's a little bit of a throwback era page, because everything on it is deprecated. but we're still gonna read it together, because knowing the old lore is how you get main character energy. πŸŽ€


✨ NAME ✨

DSA_generate_key β€” generate a DSA key pair, slay πŸ”‘


🌸 SYNOPSIS 🌸

#include <openssl/dsa.h>

okay so heads up: the functions on this page have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β€” go peek at openssl_user_macros(7) for the deets. 🫢

int DSA_generate_key(DSA *a);

πŸ¦‹ DESCRIPTION πŸ¦‹

alright, real talk: all of the functions described on this page are deprecated. not me being dramatic, that's just the facts. 😭

instead, applications should use EVP_PKEY_keygen_init(3) and EVP_PKEY_keygen(3), exactly as described in EVP_PKEY-DSA(7). that's the upgrade path, bestie β€” take it. πŸ’…

so DSA_generate_key() expects a to already contain DSA parameters. it generates a new key pair and stores it in a->pub_key and a->priv_key. that's the whole vibe β€” parameters in, key pair out. ✨

⚠️ and this part is important: the random generator must be seeded before you call DSA_generate_key().

and if the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to external circumstances (see RAND(7)), the operation will fail. no key pair, no nothing. just a fail. πŸ’€


πŸ“ RETURN VALUES πŸ“

  • DSA_generate_key() returns 1 on success, and 0 otherwise. that's it, that's the whole scale. 🌈

you can grab the error codes with ERR_get_error(3) if you need to know why it said no. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘


⭐ HISTORY ⭐

this function was deprecated in OpenSSL 3.0. periodt. πŸ’€βœ¨


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>.


and that's the page, bestie! 🧚 this little time capsule is from OpenSSL 3.5.0, dated 2026-09-25, filed under DSA_GENERATE_KEY(3ossl). go forth, use the EVP stuff, and stay iconic πŸ’…πŸ”₯

πŸ“¦ where this page comes from