1gnutls_x509_privkey_import_pkcs8(3) gnutls gnutls_x509_privkey_import_pkcs8(3)
2
3
4
6 gnutls_x509_privkey_import_pkcs8 - This function will import a DER or
7 PEM PKCS8 encoded key
8
10 #include <gnutls/x509.h>
11
12 int gnutls_x509_privkey_import_pkcs8(gnutls_x509_privkey_t key, const
13 gnutls_datum_t * data, gnutls_x509_crt_fmt_t format, const char * pass‐
14 word, unsigned int flags);
15
17 gnutls_x509_privkey_t key
18 The structure to store the parsed key
19
20 const gnutls_datum_t * data
21 The DER or PEM encoded key.
22
23 gnutls_x509_crt_fmt_t format
24 One of DER or PEM
25
26 const char * password
27 the password to decrypt the key (if it is encrypted).
28
29 unsigned int flags
30 0 if encrypted or GNUTLS_PKCS_PLAIN if not encrypted.
31
33 This function will convert the given DER or PEM encoded PKCS8 2.0
34 encrypted key to the native gnutls_x509_privkey_t format. The output
35 will be stored in key. Currently only RSA keys can be imported, and
36 flags can only be used to indicate an unencrypted key.
37
38 The password can be either ASCII or UTF-8 in the default PBES2 encryp‐
39 tion schemas, or ASCII for the PKCS12 schemas.
40
41 If the Certificate is PEM encoded it should have a header of "ENCRYPTED
42 PRIVATE KEY", or "PRIVATE KEY". You only need to specify the flags if
43 the key is DER encoded, since in that case the encryption status cannot
44 be auto-detected.
45
46 Returns 0 on success.
47
49 Report bugs to <bug-gnutls@gnu.org>.
50
52 Copyright © 2006 Free Software Foundation.
53 Permission is granted to make and distribute verbatim copies of this
54 manual provided the copyright notice and this permission notice are
55 preserved on all copies.
56
58 The full documentation for gnutls is maintained as a Texinfo manual.
59 If the info and gnutls programs are properly installed at your site,
60 the command
61
62 info gnutls
63
64 should give you access to the complete manual.
65
66
67
68gnutls 1.6.3 gnutls_x509_privkey_import_pkcs8(3)