OpenSSL DSA_sign(3openssl)
NNNNAAAAMMMMEEEEDSA_sign, DSA_sign_setup, DSA_verify - DSA signatures
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS#include
int DSA_sign(int type, const unsigned char *dgst, int len,
unsigned char *sigret, unsigned int *siglen, DSA *dsa);int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp,
BIGNUM **rp);int DSA_verify(int type, const unsigned char *dgst, int len,
unsigned char *sigbuf, int siglen, DSA *dsa); DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNDSA_sign() computes a digital signature on the lllleeeennnn byte
message digest ddddggggsssstttt using the private key ddddssssaaaa and places its ASN.1 DER encoding at ssssiiiiggggrrrreeeetttt. The length of the signature isplaces in *ssssiiiigggglllleeeennnn. ssssiiiiggggrrrreeeetttt must point to DSA_size(ddddssssaaaa) bytes
of memory.DSA_sign_setup() may be used to precompute part of the
signing operation in case signature generation is time-
critical. It expects ddddssssaaaa to contain DSA parameters. It places the precomputed values in newly allocated BBBBIIIIGGGGNNNNUUUUMMMMs at *kkkkiiiinnnnvvvvpppp and *rrrrpppp, after freeing the old ones unless *kkkkiiiinnnnvvvvpppp and*rrrrpppp are NULL. These values may be passed to DSA_sign() in
ddddssssaaaa---->>>>kkkkiiiinnnnvvvv and ddddssssaaaa---->>>>rrrr. ccccttttxxxx is a pre-allocated BBBBNNNN_CCCCTTTTXXXX or
NULL.DSA_verify() verifies that the signature ssssiiiiggggbbbbuuuuffff of size
ssssiiiigggglllleeeennnn matches a given message digest ddddggggsssstttt of size lllleeeennnn. ddddssssaaaa is the signer's public key. The ttttyyyyppppeeee parameter is ignored.The PRNG must be seeded before DSA_sign() (or
DSA_sign_setup()) is called.
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSSDSA_sign() and DSA_sign_setup() return 1 on success, 0 on
error. DSA_verify() returns 1 for a valid signature, 0 for
an incorrect signature and -1 on error. The error codes can
be obtained by ERR_get_error(3).
CCCCOOOONNNNFFFFOOOORRRRMMMMIIIINNNNGGGG TTTTOOOO US Federal Information Processing Standard FIPS 186 (Digital Signature Standard, DSS), ANSI X9.3025/Sep/2002 Last change: 0.9.8o 1
OpenSSL DSA_sign(3openssl)
SSSSEEEEEEEE AAAALLLLSSSSOOOOdsa(3), ERR_get_error(3), rand(3), DSA_do_sign(3)
HHHHIIIISSSSTTTTOOOORRRRYYYYDSA_sign() and DSA_verify() are available in all versions of
SSLeay. DSA_sign_setup() was added in SSLeay 0.8.
25/Sep/2002 Last change: 0.9.8o 2