1gnutls_x509_privkey_import_pkcs8(3) gnutls gnutls_x509_privkey_import_pkcs8(3)
2
3
4

NAME

6       gnutls_x509_privkey_import_pkcs8 - API function
7

SYNOPSIS

9       #include <gnutls/x509.h>
10
11       int  gnutls_x509_privkey_import_pkcs8(gnutls_x509_privkey_t  key, const
12       gnutls_datum_t * data, gnutls_x509_crt_fmt_t format, const char * pass‐
13       word, unsigned int flags);
14

ARGUMENTS

16       gnutls_x509_privkey_t key
17                   The structure to store the parsed key
18
19       const gnutls_datum_t * data
20                   The DER or PEM encoded key.
21
22       gnutls_x509_crt_fmt_t format
23                   One of DER or PEM
24
25       const char * password
26                   the password to decrypt the key (if it is encrypted).
27
28       unsigned int flags
29                   0 if encrypted or GNUTLS_PKCS_PLAIN if not encrypted.
30

DESCRIPTION

32       This  function  will  convert  the  given  DER or PEM encoded PKCS8 2.0
33       encrypted key to the native gnutls_x509_privkey_t  format.  The  output
34       will  be  stored  in  key.   Both RSA and DSA keys can be imported, and
35       flags can only be used to indicate an unencrypted key.
36
37       The password can be either ASCII or UTF-8 in the default PBES2  encryp‐
38       tion schemas, or ASCII for the PKCS12 schemas.
39
40       If the Certificate is PEM encoded it should have a header of "ENCRYPTED
41       PRIVATE KEY", or "PRIVATE KEY". You only need to specify the  flags  if
42       the key is DER encoded, since in that case the encryption status cannot
43       be auto-detected.
44

RETURNS

46       On success, GNUTLS_E_SUCCESS is returned, otherwise  a  negative  error
47       value.
48

REPORTING BUGS

50       Report    bugs    to    <bug-gnutls@gnu.org>.     GnuTLS   home   page:
51       http://www.gnu.org/software/gnutls/ General help  using  GNU  software:
52       http://www.gnu.org/gethelp/
53
55       Copyright © 2008 Free Software Foundation.
56       Copying  and  distribution  of this file, with or without modification,
57       are permitted in any medium  without  royalty  provided  the  copyright
58       notice and this notice are preserved.
59

SEE ALSO

61       The  full  documentation  for gnutls is maintained as a Texinfo manual.
62       If the info and gnutls programs are properly installed  at  your  site,
63       the command
64
65              info gnutls
66
67       should give you access to the complete manual.
68
69
70
71gnutls                             2.12.6.1gnutls_x509_privkey_import_pkcs8(3)
Impressum