1gnutls_privkey_generate(3) gnutls gnutls_privkey_generate(3)
2
3
4
6 gnutls_privkey_generate - API function
7
9 #include <gnutls/abstract.h>
10
11 int gnutls_privkey_generate(gnutls_privkey_t pkey, gnutls_pk_algo‐
12 rithm_t algo, unsigned int bits, unsigned int flags);
13
15 gnutls_privkey_t pkey
16 The private key
17
18 gnutls_pk_algorithm_t algo
19 is one of the algorithms in gnutls_pk_algorithm_t.
20
21 unsigned int bits
22 the size of the modulus
23
24 unsigned int flags
25 unused for now. Must be 0.
26
28 This function will generate a random private key. Note that this func‐
29 tion must be called on an empty private key.
30
31 Note that when generating an elliptic curve key, the curve can be sub‐
32 stituted in the place of the bits parameter using the
33 GNUTLS_CURVE_TO_BITS() macro.
34
35 Do not set the number of bits directly, use
36 gnutls_sec_param_to_pk_bits().
37
39 On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative
40 error value.
41
43 3.3.0
44
46 Report bugs to <bugs@gnutls.org>.
47 Home page: http://www.gnutls.org
48
49
51 Copyright © 2001-2014 Free Software Foundation, Inc..
52 Copying and distribution of this file, with or without modification,
53 are permitted in any medium without royalty provided the copyright
54 notice and this notice are preserved.
55
57 The full documentation for gnutls is maintained as a Texinfo manual.
58 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
59 visit
60
61 http://www.gnutls.org/manual/
62
63gnutls 3.3.29 gnutls_privkey_generate(3)