xref: /netbsd-src/crypto/external/bsd/openssl/dist/doc/man3/DSA_sign.pod (revision b0d1725196a7921d003d2c66a14f186abda4176b)
113d40330Schristos=pod
213d40330Schristos
313d40330Schristos=head1 NAME
413d40330Schristos
513d40330SchristosDSA_sign, DSA_sign_setup, DSA_verify - DSA signatures
613d40330Schristos
713d40330Schristos=head1 SYNOPSIS
813d40330Schristos
913d40330Schristos #include <openssl/dsa.h>
1013d40330Schristos
11*b0d17251SchristosThe following functions have been deprecated since OpenSSL 3.0, and can be
12*b0d17251Schristoshidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
13*b0d17251Schristossee L<openssl_user_macros(7)>:
14*b0d17251Schristos
1513d40330Schristos int DSA_sign(int type, const unsigned char *dgst, int len,
1613d40330Schristos              unsigned char *sigret, unsigned int *siglen, DSA *dsa);
1713d40330Schristos
1813d40330Schristos int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp);
1913d40330Schristos
2013d40330Schristos int DSA_verify(int type, const unsigned char *dgst, int len,
2113d40330Schristos                unsigned char *sigbuf, int siglen, DSA *dsa);
2213d40330Schristos
2313d40330Schristos=head1 DESCRIPTION
2413d40330Schristos
25*b0d17251SchristosAll of the functions described on this page are deprecated.
26*b0d17251SchristosApplications should instead use L<EVP_PKEY_sign_init(3)>, L<EVP_PKEY_sign(3)>,
27*b0d17251SchristosL<EVP_PKEY_verify_init(3)> and L<EVP_PKEY_verify(3)>.
28*b0d17251Schristos
2913d40330SchristosDSA_sign() computes a digital signature on the B<len> byte message
3013d40330Schristosdigest B<dgst> using the private key B<dsa> and places its ASN.1 DER
3113d40330Schristosencoding at B<sigret>. The length of the signature is places in
3213d40330Schristos*B<siglen>. B<sigret> must point to DSA_size(B<dsa>) bytes of memory.
3313d40330Schristos
3413d40330SchristosDSA_sign_setup() is defined only for backward binary compatibility and
3513d40330Schristosshould not be used.
3613d40330SchristosSince OpenSSL 1.1.0 the DSA type is opaque and the output of
3713d40330SchristosDSA_sign_setup() cannot be used anyway: calling this function will only
3813d40330Schristoscause overhead, and does not affect the actual signature
3913d40330Schristos(pre-)computation.
4013d40330Schristos
4113d40330SchristosDSA_verify() verifies that the signature B<sigbuf> of size B<siglen>
4213d40330Schristosmatches a given message digest B<dgst> of size B<len>.
4313d40330SchristosB<dsa> is the signer's public key.
4413d40330Schristos
4513d40330SchristosThe B<type> parameter is ignored.
4613d40330Schristos
474ce06407SchristosThe random generator must be seeded when DSA_sign() (or DSA_sign_setup())
4813d40330Schristosis called.
494ce06407SchristosIf the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
504ce06407Schristosexternal circumstances (see L<RAND(7)>), the operation will fail.
5113d40330Schristos
5213d40330Schristos=head1 RETURN VALUES
5313d40330Schristos
5413d40330SchristosDSA_sign() and DSA_sign_setup() return 1 on success, 0 on error.
5513d40330SchristosDSA_verify() returns 1 for a valid signature, 0 for an incorrect
5613d40330Schristossignature and -1 on error. The error codes can be obtained by
5713d40330SchristosL<ERR_get_error(3)>.
5813d40330Schristos
5913d40330Schristos=head1 CONFORMING TO
6013d40330Schristos
61*b0d17251SchristosUS Federal Information Processing Standard FIPS186-4 (Digital Signature
6213d40330SchristosStandard, DSS), ANSI X9.30
6313d40330Schristos
6413d40330Schristos=head1 SEE ALSO
6513d40330Schristos
6613d40330SchristosL<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
674ce06407SchristosL<DSA_do_sign(3)>,
684ce06407SchristosL<RAND(7)>
6913d40330Schristos
70*b0d17251Schristos=head1 HISTORY
71*b0d17251Schristos
72*b0d17251SchristosAll of these functions were deprecated in OpenSSL 3.0.
73*b0d17251Schristos
7413d40330Schristos=head1 COPYRIGHT
7513d40330Schristos
76*b0d17251SchristosCopyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
7713d40330Schristos
78*b0d17251SchristosLicensed under the Apache License 2.0 (the "License").  You may not use
7913d40330Schristosthis file except in compliance with the License.  You can obtain a copy
8013d40330Schristosin the file LICENSE in the source distribution or at
8113d40330SchristosL<https://www.openssl.org/source/license.html>.
8213d40330Schristos
8313d40330Schristos=cut
84