xref: /netbsd-src/crypto/external/bsd/openssl.old/dist/doc/man3/DSA_generate_key.pod (revision 4724848cf0da353df257f730694b7882798e5daf)
1*4724848cSchristos=pod
2*4724848cSchristos
3*4724848cSchristos=head1 NAME
4*4724848cSchristos
5*4724848cSchristosDSA_generate_key - generate DSA key pair
6*4724848cSchristos
7*4724848cSchristos=head1 SYNOPSIS
8*4724848cSchristos
9*4724848cSchristos #include <openssl/dsa.h>
10*4724848cSchristos
11*4724848cSchristos int DSA_generate_key(DSA *a);
12*4724848cSchristos
13*4724848cSchristos=head1 DESCRIPTION
14*4724848cSchristos
15*4724848cSchristosDSA_generate_key() expects B<a> to contain DSA parameters. It generates
16*4724848cSchristosa new key pair and stores it in B<a-E<gt>pub_key> and B<a-E<gt>priv_key>.
17*4724848cSchristos
18*4724848cSchristosThe random generator must be seeded prior to calling DSA_generate_key().
19*4724848cSchristosIf the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
20*4724848cSchristosexternal circumstances (see L<RAND(7)>), the operation will fail.
21*4724848cSchristos
22*4724848cSchristos=head1 RETURN VALUES
23*4724848cSchristos
24*4724848cSchristosDSA_generate_key() returns 1 on success, 0 otherwise.
25*4724848cSchristosThe error codes can be obtained by L<ERR_get_error(3)>.
26*4724848cSchristos
27*4724848cSchristos=head1 SEE ALSO
28*4724848cSchristos
29*4724848cSchristosL<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
30*4724848cSchristosL<DSA_generate_parameters_ex(3)>
31*4724848cSchristos
32*4724848cSchristos=head1 COPYRIGHT
33*4724848cSchristos
34*4724848cSchristosCopyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
35*4724848cSchristos
36*4724848cSchristosLicensed under the OpenSSL license (the "License").  You may not use
37*4724848cSchristosthis file except in compliance with the License.  You can obtain a copy
38*4724848cSchristosin the file LICENSE in the source distribution or at
39*4724848cSchristosL<https://www.openssl.org/source/license.html>.
40*4724848cSchristos
41*4724848cSchristos=cut
42