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 π
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
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms