xref: /netbsd-src/crypto/external/bsd/openssl.old/dist/doc/man3/DSA_sign.pod (revision 4724848cf0da353df257f730694b7882798e5daf)
1*4724848cSchristos=pod
2*4724848cSchristos
3*4724848cSchristos=head1 NAME
4*4724848cSchristos
5*4724848cSchristosDSA_sign, DSA_sign_setup, DSA_verify - DSA signatures
6*4724848cSchristos
7*4724848cSchristos=head1 SYNOPSIS
8*4724848cSchristos
9*4724848cSchristos #include <openssl/dsa.h>
10*4724848cSchristos
11*4724848cSchristos int DSA_sign(int type, const unsigned char *dgst, int len,
12*4724848cSchristos              unsigned char *sigret, unsigned int *siglen, DSA *dsa);
13*4724848cSchristos
14*4724848cSchristos int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp);
15*4724848cSchristos
16*4724848cSchristos int DSA_verify(int type, const unsigned char *dgst, int len,
17*4724848cSchristos                unsigned char *sigbuf, int siglen, DSA *dsa);
18*4724848cSchristos
19*4724848cSchristos=head1 DESCRIPTION
20*4724848cSchristos
21*4724848cSchristosDSA_sign() computes a digital signature on the B<len> byte message
22*4724848cSchristosdigest B<dgst> using the private key B<dsa> and places its ASN.1 DER
23*4724848cSchristosencoding at B<sigret>. The length of the signature is places in
24*4724848cSchristos*B<siglen>. B<sigret> must point to DSA_size(B<dsa>) bytes of memory.
25*4724848cSchristos
26*4724848cSchristosDSA_sign_setup() is defined only for backward binary compatibility and
27*4724848cSchristosshould not be used.
28*4724848cSchristosSince OpenSSL 1.1.0 the DSA type is opaque and the output of
29*4724848cSchristosDSA_sign_setup() cannot be used anyway: calling this function will only
30*4724848cSchristoscause overhead, and does not affect the actual signature
31*4724848cSchristos(pre-)computation.
32*4724848cSchristos
33*4724848cSchristosDSA_verify() verifies that the signature B<sigbuf> of size B<siglen>
34*4724848cSchristosmatches a given message digest B<dgst> of size B<len>.
35*4724848cSchristosB<dsa> is the signer's public key.
36*4724848cSchristos
37*4724848cSchristosThe B<type> parameter is ignored.
38*4724848cSchristos
39*4724848cSchristosThe random generator must be seeded when DSA_sign() (or DSA_sign_setup())
40*4724848cSchristosis called.
41*4724848cSchristosIf the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
42*4724848cSchristosexternal circumstances (see L<RAND(7)>), the operation will fail.
43*4724848cSchristos
44*4724848cSchristos=head1 RETURN VALUES
45*4724848cSchristos
46*4724848cSchristosDSA_sign() and DSA_sign_setup() return 1 on success, 0 on error.
47*4724848cSchristosDSA_verify() returns 1 for a valid signature, 0 for an incorrect
48*4724848cSchristossignature and -1 on error. The error codes can be obtained by
49*4724848cSchristosL<ERR_get_error(3)>.
50*4724848cSchristos
51*4724848cSchristos=head1 CONFORMING TO
52*4724848cSchristos
53*4724848cSchristosUS Federal Information Processing Standard FIPS 186 (Digital Signature
54*4724848cSchristosStandard, DSS), ANSI X9.30
55*4724848cSchristos
56*4724848cSchristos=head1 SEE ALSO
57*4724848cSchristos
58*4724848cSchristosL<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
59*4724848cSchristosL<DSA_do_sign(3)>,
60*4724848cSchristosL<RAND(7)>
61*4724848cSchristos
62*4724848cSchristos=head1 COPYRIGHT
63*4724848cSchristos
64*4724848cSchristosCopyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
65*4724848cSchristos
66*4724848cSchristosLicensed under the OpenSSL license (the "License").  You may not use
67*4724848cSchristosthis file except in compliance with the License.  You can obtain a copy
68*4724848cSchristosin the file LICENSE in the source distribution or at
69*4724848cSchristosL<https://www.openssl.org/source/license.html>.
70*4724848cSchristos
71*4724848cSchristos=cut
72