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. Both RSA and DSA 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
47 On success, GNUTLS_E_SUCCESS is returned, otherwise a negative error
48 value.
49
51 Report bugs to <bug-gnutls@gnu.org>. GnuTLS home page:
52 http://www.gnu.org/software/gnutls/ General help using GNU software:
53 http://www.gnu.org/gethelp/
54
56 Copyright © 2008 Free Software Foundation.
57 Copying and distribution of this file, with or without modification,
58 are permitted in any medium without royalty provided the copyright
59 notice and this notice are preserved.
60
62 The full documentation for gnutls is maintained as a Texinfo manual.
63 If the info and gnutls programs are properly installed at your site,
64 the command
65
66 info gnutls
67
68 should give you access to the complete manual.
69
70
71
72gnutls 2.8.6 gnutls_x509_privkey_import_pkcs8(3)