DSA_GENERATE_KEY(3ossl)
π DSA_generate_key β generate DSA key pair π
okay bestie, so this page lives in the 3ossl manual section, and the whole vibe is: this function is retired, but we still gotta know what it did. Let's get into it β¨
πΈ SYNOPSIS πΈ
#include <openssl/dsa.h>
The following functions have been deprecated since OpenSSL 3.0, and can be hidden entirely by defining OPENSSL_API_COMPAT with a suitable version value, see openssl_user_macros(7):
int DSA_generate_key(DSA *a);
π DESCRIPTION π
All of the functions described on this page are deprecated. Like, all of them, 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 main character path now, fr fr.
So, what did the old one do? DSA_generate_key() expects a to contain DSA parameters. It generates a new key pair and stores it in a->pub_key and a->priv_key. Cute, right? π
π«Ά Heads up: the random generator must be seeded prior to callingDSA_generate_key(). And if the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to external circumstances (seeRAND(7)), the operation will fail. Not being dramatic, that's literally what the page says π
π₯ RETURN VALUES π₯
DSA_generate_key()returns1on success,0otherwise.
The error codes can be obtained by ERR_get_error(3). Slay, at least we can find out what went wrong π©Ίβ¨
π¦ SEE ALSO π¦
β HISTORY β
This function was deprecated in OpenSSL 3.0. RIP to a real one π―οΈ
π 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>.
and that's the whole page bestie π this was OpenSSL 3.5.6, dated 2026-04-07, filed under DSA_GENERATE_KEY(3ossl) β now go use the EVP functions, ily, mwah π«Άβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms