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, BIGNUM **rp);
15
16        int DSA_verify(int type, const unsigned char *dgst, int len,
17                       unsigned char *sigbuf, int siglen, DSA *dsa);
18

DESCRIPTION

20       DSA_sign() computes a digital signature on the len byte message digest
21       dgst using the private key dsa and places its ASN.1 DER encoding at
22       sigret. The length of the signature is places in *siglen. sigret must
23       point to DSA_size(dsa) bytes of memory.
24
25       DSA_sign_setup() is defined only for backward binary compatibility and
26       should not be used.  Since OpenSSL 1.1.0 the DSA type is opaque and the
27       output of DSA_sign_setup() cannot be used anyway: calling this function
28       will only cause overhead, and does not affect the actual signature
29       (pre-)computation.
30
31       DSA_verify() verifies that the signature sigbuf of size siglen matches
32       a given message digest dgst of size len.  dsa is the signer's public
33       key.
34
35       The type parameter is ignored.
36
37       The random generator must be seeded when DSA_sign() (or
38       DSA_sign_setup()) is called.  If the automatic seeding or reseeding of
39       the OpenSSL CSPRNG fails due to external circumstances (see RAND(7)),
40       the operation will fail.
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_new(3), ERR_get_error(3), RAND_bytes(3), DSA_do_sign(3), RAND(7)
54
56       Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
57
58       Licensed under the OpenSSL license (the "License").  You may not use
59       this file except in compliance with the License.  You can obtain a copy
60       in the file LICENSE in the source distribution or at
61       <https://www.openssl.org/source/license.html>.
62
63
64
651.1.1q                            2022-07-07                       DSA_SIGN(3)
Impressum