1gnutls_pkcs11_privkey_generate3(3) gnutls gnutls_pkcs11_privkey_generate3(3)
2
3
4
6 gnutls_pkcs11_privkey_generate3 - API function
7
9 #include <gnutls/pkcs11.h>
10
11 int gnutls_pkcs11_privkey_generate3(const char * url, gnutls_pk_algo‐
12 rithm_t pk, unsigned int bits, const char * label, const gnutls_datum_t
13 * cid, gnutls_x509_crt_fmt_t fmt, gnutls_datum_t * pubkey, unsigned int
14 key_usage, unsigned int 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 const gnutls_datum_t * cid
30 The CKA_ID to use for the new object
31
32 gnutls_x509_crt_fmt_t fmt
33 the format of output params. PEM or DER
34
35 gnutls_datum_t * pubkey
36 will hold the public key (may be NULL)
37
38 unsigned int key_usage
39 One of GNUTLS_KEY_*
40
41 unsigned int flags
42 zero or an OR'ed sequence of GNUTLS_PKCS11_OBJ_FLAGs
43
45 This function will generate a private key in the specified by the url
46 token. The private key will be generate within the token and will not
47 be exportable. This function will store the DER-encoded public key in
48 the SubjectPublicKeyInfo format in pubkey . The pubkey should be
49 deinitialized using gnutls_free().
50
51 Note that when generating an elliptic curve key, the curve can be sub‐
52 stituted in the place of the bits parameter using the
53 GNUTLS_CURVE_TO_BITS() macro.
54
55 Since 3.6.3 the objects are marked as sensitive by default unless
56 GNUTLS_PKCS11_OBJ_FLAG_MARK_NOT_SENSITIVE is specified.
57
59 On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative er‐
60 ror value.
61
63 3.4.0
64
66 Report bugs to <bugs@gnutls.org>.
67 Home page: https://www.gnutls.org
68
69
71 Copyright © 2001-2023 Free Software Foundation, Inc., and others.
72 Copying and distribution of this file, with or without modification,
73 are permitted in any medium without royalty provided the copyright no‐
74 tice and this notice are preserved.
75
77 The full documentation for gnutls is maintained as a Texinfo manual.
78 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
79 visit
80
81 https://www.gnutls.org/manual/
82
83gnutls 3.8.2 gnutls_pkcs11_privkey_generate3(3)