DSA_DO_SIGN(3SSL)
π DSA_DO_SIGN π
okay bestie, welcome to the DSA_DO_SIGN(3SSL) page β that's the OpenSSL manual, section 3SSL, and today we're talking about the raw DSA signature operations. which is a lot of words for "sign stuff, check stuff, but do it the manual way". let's get into it β¨
πΈ NAME πΈ
DSA_do_sign, DSA_do_verify β raw DSA signature operations. yes that's literally it, no more no less, it's giving "what it says on the tin" π
π SYNOPSIS π
first things first, you gotta include the header:
#include <openssl/dsa.h>
π¨ okay so real talk: these functions have been deprecated since OpenSSL 3.0, and you can make them vanish entirely by definingOPENSSL_API_COMPATwith a suitable version value. more on that inopenssl_user_macros(7). don't say I didn't warn you π
here are the signatures, copy 'em exactly bestie:
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 π¦
every single function on this page is deprecated. all of them. not one survivor. so like, if you're writing new code, please please please use these instead:
that's the glow-up route β¨
so what does DSA_do_sign() actually do? it computes a digital signature on the len byte message digest dgst using the private key dsa, and hands it back to you in a newly allocated DSA_SIG structure. brand new, fresh out the box, it's yours to free π
oh and pro tip: DSA_sign_setup(3) can be used to precompute part of the signing operation, which is the move if signature generation is time-critical and you're in your speed era β‘
then DSA_do_verify() checks whether the signature sig matches a given message digest dgst of size len. and dsa here? that's the signer's public key, bestie. public. do not mix those up I am begging π
π RETURN VALUES π
DSA_do_sign()β returns the signature, orNULLon error. no signature, no vibes πDSA_do_verify()β returns1for a valid signature β ,0for an incorrect signature β, and-1on error π
and if you got an error, you can grab the error codes with ERR_get_error(3). iykyk
π SEE ALSO π
go read these too, they're all part of the friend group:
π HISTORY π
all of these functions were deprecated in OpenSSL 3.0. that's the whole history lesson, periodt π
π 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 page bestie!! this iconic little manual moment is from OpenSSL 4.0.3, dated 2026-09-29 β DSA_DO_SIGN(3SSL), forever in our hearts π«Άπβ¨
π¦ 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