1e1051a39Sopenharmony_ci=pod
2e1051a39Sopenharmony_ci
3e1051a39Sopenharmony_ci=head1 NAME
4e1051a39Sopenharmony_ci
5e1051a39Sopenharmony_ciDSA_generate_key - generate DSA key pair
6e1051a39Sopenharmony_ci
7e1051a39Sopenharmony_ci=head1 SYNOPSIS
8e1051a39Sopenharmony_ci
9e1051a39Sopenharmony_ci #include <openssl/dsa.h>
10e1051a39Sopenharmony_ci
11e1051a39Sopenharmony_ciThe following functions have been deprecated since OpenSSL 3.0, and can be
12e1051a39Sopenharmony_cihidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
13e1051a39Sopenharmony_cisee L<openssl_user_macros(7)>:
14e1051a39Sopenharmony_ci
15e1051a39Sopenharmony_ci int DSA_generate_key(DSA *a);
16e1051a39Sopenharmony_ci
17e1051a39Sopenharmony_ci=head1 DESCRIPTION
18e1051a39Sopenharmony_ci
19e1051a39Sopenharmony_ciAll of the functions described on this page are deprecated.
20e1051a39Sopenharmony_ciApplications should instead use L<EVP_PKEY_keygen_init(3)> and
21e1051a39Sopenharmony_ciL<EVP_PKEY_keygen(3)> as described in L<EVP_PKEY-DSA(7)>.
22e1051a39Sopenharmony_ci
23e1051a39Sopenharmony_ciDSA_generate_key() expects B<a> to contain DSA parameters. It generates
24e1051a39Sopenharmony_cia new key pair and stores it in B<a-E<gt>pub_key> and B<a-E<gt>priv_key>.
25e1051a39Sopenharmony_ci
26e1051a39Sopenharmony_ciThe random generator must be seeded prior to calling DSA_generate_key().
27e1051a39Sopenharmony_ciIf the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
28e1051a39Sopenharmony_ciexternal circumstances (see L<RAND(7)>), the operation will fail.
29e1051a39Sopenharmony_ci
30e1051a39Sopenharmony_ci=head1 RETURN VALUES
31e1051a39Sopenharmony_ci
32e1051a39Sopenharmony_ciDSA_generate_key() returns 1 on success, 0 otherwise.
33e1051a39Sopenharmony_ciThe error codes can be obtained by L<ERR_get_error(3)>.
34e1051a39Sopenharmony_ci
35e1051a39Sopenharmony_ci=head1 SEE ALSO
36e1051a39Sopenharmony_ci
37e1051a39Sopenharmony_ciL<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
38e1051a39Sopenharmony_ciL<DSA_generate_parameters_ex(3)>
39e1051a39Sopenharmony_ci
40e1051a39Sopenharmony_ci=head1 HISTORY
41e1051a39Sopenharmony_ci
42e1051a39Sopenharmony_ciThis function was deprecated in OpenSSL 3.0.
43e1051a39Sopenharmony_ci
44e1051a39Sopenharmony_ci=head1 COPYRIGHT
45e1051a39Sopenharmony_ci
46e1051a39Sopenharmony_ciCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
47e1051a39Sopenharmony_ci
48e1051a39Sopenharmony_ciLicensed under the Apache License 2.0 (the "License").  You may not use
49e1051a39Sopenharmony_cithis file except in compliance with the License.  You can obtain a copy
50e1051a39Sopenharmony_ciin the file LICENSE in the source distribution or at
51e1051a39Sopenharmony_ciL<https://www.openssl.org/source/license.html>.
52e1051a39Sopenharmony_ci
53e1051a39Sopenharmony_ci=cut
54