1gnutls_x509_privkey_export_pkcs8(3) gnutls gnutls_x509_privkey_export_pkcs8(3)
2
3
4

NAME

6       gnutls_x509_privkey_export_pkcs8  -  This function will export the pri‐
7       vate key to PKCS8 format
8

SYNOPSIS

10       #include <gnutls/x509.h>
11
12       int     gnutls_x509_privkey_export_pkcs8(gnutls_x509_privkey_t     key,
13       gnutls_x509_crt_fmt_t  format,  const  char  *  password,  unsigned int
14       flags, void * output_data, size_t * output_data_size);
15

ARGUMENTS

17       gnutls_x509_privkey_t key
18                   Holds the key
19
20       gnutls_x509_crt_fmt_t format
21                   the format of output params. One of PEM or DER.
22
23       const char * password
24                   the password that will be used to encrypt the key.
25
26       unsigned int flags
27                   an ORed sequence of gnutls_pkcs_encrypt_flags_t
28
29       void * output_data
30                   will contain a private key PEM or DER encoded
31
32       size_t * output_data_size
33                   holds the size of output_data (and will be replaced by  the
34                   actual size of parameters)
35

DESCRIPTION

37       This  function  will export the private key to a PKCS8 structure.  Cur‐
38       rently only RSA keys can be exported since there is no documented stan‐
39       dard for other keys. If the flags do not specify the encryption cipher,
40       then the default 3DES (PBES2) will be used.
41
42       The password can be either ASCII or UTF-8 in the default PBES2  encryp‐
43       tion schemas, or ASCII for the PKCS12 schemas.
44
45       If  the  buffer  provided  is  not long enough to hold the output, then
46       *output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER  will  be
47       returned.
48
49       If  the  structure  is  PEM  encoded,  it  will have a header of "BEGIN
50       ENCRYPTED PRIVATE KEY" or "BEGIN PRIVATE  KEY"  if  encryption  is  not
51       used.
52

RETURN VALUE

54       In case of failure a negative value will be returned, and 0 on success.
55

REPORTING BUGS

57       Report bugs to <bug-gnutls@gnu.org>.
58
60       Copyright © 2006 Free Software Foundation.
61       Permission  is  granted  to make and distribute verbatim copies of this
62       manual provided the copyright notice and  this  permission  notice  are
63       preserved on all copies.
64

SEE ALSO

66       The  full  documentation  for gnutls is maintained as a Texinfo manual.
67       If the info and gnutls programs are properly installed  at  your  site,
68       the command
69
70              info gnutls
71
72       should give you access to the complete manual.
73
74
75
76gnutls                               1.6.3 gnutls_x509_privkey_export_pkcs8(3)
Impressum