1gnutls_pkcs11_privkey_generate2(3) gnutls gnutls_pkcs11_privkey_generate2(3)
2
3
4
6 gnutls_pkcs11_privkey_generate2 - API function
7
9 #include <gnutls/pkcs11.h>
10
11 int gnutls_pkcs11_privkey_generate2(const char * url, gnutls_pk_algo‐
12 rithm_t pk, unsigned int bits, const char * label,
13 gnutls_x509_crt_fmt_t fmt, gnutls_datum_t * pubkey, unsigned int
14 flags);
15
17 const char * url
18 a token URL
19
20 gnutls_pk_algorithm_t pk
21 the public key algorithm
22
23 unsigned int bits
24 the security bits
25
26 const char * label
27 a label
28
29 gnutls_x509_crt_fmt_t fmt
30 the format of output params. PEM or DER
31
32 gnutls_datum_t * pubkey
33 will hold the public key (may be NULL)
34
35 unsigned int flags
36 zero or an OR'ed sequence of GNUTLS_PKCS11_OBJ_FLAGs
37
39 This function will generate a private key in the specified by the url
40 token. The private key will be generate within the token and will not
41 be exportable. This function will store the DER-encoded public key in
42 the SubjectPublicKeyInfo format in pubkey . The pubkey should be
43 deinitialized using gnutls_free().
44
45 Note that when generating an elliptic curve key, the curve can be sub‐
46 stituted in the place of the bits parameter using the
47 GNUTLS_CURVE_TO_BITS() macro.
48
50 On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative er‐
51 ror value.
52
54 3.1.5
55
57 Report bugs to <bugs@gnutls.org>.
58 Home page: https://www.gnutls.org
59
60
62 Copyright © 2001- Free Software Foundation, Inc., and others.
63 Copying and distribution of this file, with or without modification,
64 are permitted in any medium without royalty provided the copyright no‐
65 tice and this notice are preserved.
66
68 The full documentation for gnutls is maintained as a Texinfo manual.
69 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
70 visit
71
72 https://www.gnutls.org/manual/
73
74gnutls 3.7.8 gnutls_pkcs11_privkey_generate2(3)