1DSA_sign(3)                         OpenSSL                        DSA_sign(3)
2
3
4

NAME

6       DSA_sign, DSA_sign_setup, DSA_verify - DSA signatures
7

SYNOPSIS

9        #include <openssl/dsa.h>
10
11        int    DSA_sign(int type, const unsigned char *dgst, int len,
12                       unsigned char *sigret, unsigned int *siglen, DSA *dsa);
13
14        int    DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp,
15                       BIGNUM **rp);
16
17        int    DSA_verify(int type, const unsigned char *dgst, int len,
18                       unsigned char *sigbuf, int siglen, DSA *dsa);
19

DESCRIPTION

21       DSA_sign() computes a digital signature on the len byte message digest
22       dgst using the private key dsa and places its ASN.1 DER encoding at
23       sigret. The length of the signature is places in *siglen. sigret must
24       point to DSA_size(dsa) bytes of memory.
25
26       DSA_sign_setup() may be used to precompute part of the signing
27       operation in case signature generation is time-critical. It expects dsa
28       to contain DSA parameters. It places the precomputed values in newly
29       allocated BIGNUMs at *kinvp and *rp, after freeing the old ones unless
30       *kinvp and *rp are NULL. These values may be passed to DSA_sign() in
31       dsa->kinv and dsa->r.  ctx is a pre-allocated BN_CTX or NULL.
32
33       DSA_verify() verifies that the signature sigbuf of size siglen matches
34       a given message digest dgst of size len.  dsa is the signer's public
35       key.
36
37       The type parameter is ignored.
38
39       The PRNG must be seeded before DSA_sign() (or DSA_sign_setup()) is
40       called.
41

RETURN VALUES

43       DSA_sign() and DSA_sign_setup() return 1 on success, 0 on error.
44       DSA_verify() returns 1 for a valid signature, 0 for an incorrect
45       signature and -1 on error. The error codes can be obtained by
46       ERR_get_error(3).
47

CONFORMING TO

49       US Federal Information Processing Standard FIPS 186 (Digital Signature
50       Standard, DSS), ANSI X9.30
51

SEE ALSO

53       dsa(3), ERR_get_error(3), rand(3), DSA_do_sign(3)
54

HISTORY

56       DSA_sign() and DSA_verify() are available in all versions of SSLeay.
57       DSA_sign_setup() was added in SSLeay 0.8.
58
59
60
611.0.2o                            2020-08-01                       DSA_sign(3)
Impressum