DSA_DO_SIGN(3ossl)

πŸ’– DSA_DO_SIGN(3ossl) β€” the raw DSA signature ops page, bestie edition πŸ’–

okay so you opened the 3ossl manual and landed on DSA_DO_SIGN. no cap, this one's a lil spicy because everything on this page is deprecated β€” but we're gonna read it together anyway because knowing the old stuff is how you understand the new stuff. iykyk 🫢


✨ NAME ✨

DSA_do_sign, DSA_do_verify β€” raw DSA signature operations, literally just the bare-metal signing and verifying, no fancy wrapper, no nothing πŸŽ€


🌸 SYNOPSIS 🌸

#include <openssl/dsa.h>

so like, heads up: 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 β€” peep openssl_user_macros(7) for the deets πŸ’…

DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);

int DSA_do_verify(const unsigned char *dgst, int dgst_len,
                  DSA_SIG *sig, DSA *dsa);

πŸ¦‹ DESCRIPTION πŸ¦‹

all of the functions described on this page are deprecated. bestie i am not kidding. 😭

applications should instead use EVP_PKEY_sign_init(3), EVP_PKEY_sign(3), EVP_PKEY_verify_init(3) and EVP_PKEY_verify(3). those are the main character functions now πŸ‘‘

DSA_do_sign() computes a digital signature on the len byte message digest dgst using the private key dsa, and returns it in a newly allocated DSA_SIG structure. fresh out the oven, just for you ✨

DSA_sign_setup(3) may be used to precompute part of the signing operation in case signature generation is time-critical β€” like, if you're on a deadline and need those signatures now, that's your girl πŸƒβ™€οΈπŸ’¨

DSA_do_verify() verifies that the signature sig matches a given message digest dgst of size len. and dsa here is the signer's public key, not the private one β€” vibe check passed, that's the one you're allowed to share 🌈


πŸ’… RETURN VALUES πŸ’…

  • DSA_do_sign() returns the signature, or NULL on error. no signature, no party. πŸ’€
  • DSA_do_verify() returns 1 for a valid signature, 0 for an incorrect signature, and -1 on error. three moods, pick one.

the error codes can be obtained by ERR_get_error(3) β€” go ask, she'll tell you what went wrong πŸ”


πŸŽ€ SEE ALSO πŸŽ€

DSA_new(3), ERR_get_error(3), RAND_bytes(3), DSA_SIG_new(3), DSA_sign(3)

go read those too, they're the friend group 🫢


⭐ HISTORY ⭐

all of these functions were deprecated in OpenSSL 3.0. so yeah, they've been in their retirement era for a minute now πŸ™ˆ


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!! no notes, we ate πŸ’–βœ¨ this was DSA_DO_SIGN(3ossl) from OpenSSL 3.5.9, dated 2026-09-29 β€” slay, go forth and please use EVP_PKEY_sign(3) instead, mwah πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from