xref: /freebsd/crypto/openssl/doc/man3/DSA_do_sign.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimDSA_do_sign, DSA_do_verify - raw DSA signature operations
6e71b7053SJung-uk Kim
7e71b7053SJung-uk Kim=head1 SYNOPSIS
8e71b7053SJung-uk Kim
9e71b7053SJung-uk Kim #include <openssl/dsa.h>
10e71b7053SJung-uk Kim
11*b077aed3SPierre ProncheryThe following functions have been deprecated since OpenSSL 3.0, and can be
12*b077aed3SPierre Proncheryhidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
13*b077aed3SPierre Proncherysee L<openssl_user_macros(7)>:
14*b077aed3SPierre Pronchery
15e71b7053SJung-uk Kim DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
16e71b7053SJung-uk Kim
17e71b7053SJung-uk Kim int DSA_do_verify(const unsigned char *dgst, int dgst_len,
18e71b7053SJung-uk Kim                   DSA_SIG *sig, DSA *dsa);
19e71b7053SJung-uk Kim
20e71b7053SJung-uk Kim=head1 DESCRIPTION
21e71b7053SJung-uk Kim
22*b077aed3SPierre ProncheryAll of the functions described on this page are deprecated.
23*b077aed3SPierre ProncheryApplications should instead use L<EVP_PKEY_sign_init(3)>, L<EVP_PKEY_sign(3)>,
24*b077aed3SPierre ProncheryL<EVP_PKEY_verify_init(3)> and L<EVP_PKEY_verify(3)>.
25*b077aed3SPierre Pronchery
26e71b7053SJung-uk KimDSA_do_sign() computes a digital signature on the B<len> byte message
27e71b7053SJung-uk Kimdigest B<dgst> using the private key B<dsa> and returns it in a
28e71b7053SJung-uk Kimnewly allocated B<DSA_SIG> structure.
29e71b7053SJung-uk Kim
30e71b7053SJung-uk KimL<DSA_sign_setup(3)> may be used to precompute part
31e71b7053SJung-uk Kimof the signing operation in case signature generation is
32e71b7053SJung-uk Kimtime-critical.
33e71b7053SJung-uk Kim
34e71b7053SJung-uk KimDSA_do_verify() verifies that the signature B<sig> matches a given
35e71b7053SJung-uk Kimmessage digest B<dgst> of size B<len>.  B<dsa> is the signer's public
36e71b7053SJung-uk Kimkey.
37e71b7053SJung-uk Kim
38e71b7053SJung-uk Kim=head1 RETURN VALUES
39e71b7053SJung-uk Kim
40e71b7053SJung-uk KimDSA_do_sign() returns the signature, NULL on error.  DSA_do_verify()
41e71b7053SJung-uk Kimreturns 1 for a valid signature, 0 for an incorrect signature and -1
42e71b7053SJung-uk Kimon error. The error codes can be obtained by
43e71b7053SJung-uk KimL<ERR_get_error(3)>.
44e71b7053SJung-uk Kim
45e71b7053SJung-uk Kim=head1 SEE ALSO
46e71b7053SJung-uk Kim
47e71b7053SJung-uk KimL<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
48e71b7053SJung-uk KimL<DSA_SIG_new(3)>,
49e71b7053SJung-uk KimL<DSA_sign(3)>
50e71b7053SJung-uk Kim
51*b077aed3SPierre Pronchery=head1 HISTORY
52*b077aed3SPierre Pronchery
53*b077aed3SPierre ProncheryAll of these functions were deprecated in OpenSSL 3.0.
54*b077aed3SPierre Pronchery
55e71b7053SJung-uk Kim=head1 COPYRIGHT
56e71b7053SJung-uk Kim
57*b077aed3SPierre ProncheryCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
58e71b7053SJung-uk Kim
59*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
60e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
61e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
62e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
63e71b7053SJung-uk Kim
64e71b7053SJung-uk Kim=cut
65