DSA_GENERATE_KEY(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’œ 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 calling 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. Not being dramatic, that's literally what the page says πŸ’€

πŸ”₯ RETURN VALUES πŸ”₯

  • DSA_generate_key() returns 1 on success, 0 otherwise.

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