DSA_GENERATE_KEY(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’– DSA_GENERATE_KEY(3) πŸ’–

okay so bestie, this one lives in the Library Functions Manual and it's literally the page for DSA_generate_key β€” yes, the whole entire slay that makes you a DSA key pair ✨


🌸 NAME 🌸

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


πŸŽ€ SYNOPSIS πŸŽ€

like, pull it in from libcrypto first:

library β€œlibcrypto”
#include <openssl/dsa.h>

int
DSA_generate_key(DSA *a);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so DSA_generate_key() is gonna need a to already be holding DSA parameters β€” like, that's the vibe check it does first, it's not doing that part for you πŸ™ˆ

then it generates a whole new key pair and stores it in a->pub_key and a->priv_key. both of them. that's the entire personality of this function and honestly? iconic πŸ‘‘


⭐ RETURN VALUES ⭐

  • DSA_generate_key() returns 1 on success πŸ’…
  • or 0 otherwise 😭

and if you got a 0 and you're like "okay but why", the error codes are literally obtainable via ERR_get_error(3) β€” go ask, she'll tell you 🫢


🌈 SEE ALSO 🌈

(the whole friend group, fr fr 🧚)


πŸ’œ HISTORY πŸ’œ

so DSA_generate_key() first appeared in SSLeay 0.6.0 and has been available since OpenBSD 2.4 β€” she's been serving since before most of us were born, we stan a legacy queen πŸ‘‘


and that's the page!! this little beauty is from Debian, dated June 8, 2025, and yes the footer still says DSA_GENERATE_KEY(3) because we keep the branding consistent πŸ’–βœ¨ bye bestie, go make some keys πŸ“

πŸ“¦ where this page comes from