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.  Both
38       RSA and DSA keys can be exported. For DSA keys we use PKCS  11  defini‐
39       tions.  If  the  flags  do  not specify the encryption cipher, then the
40       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>.     GnuTLS   home   page:
58       http://www.gnu.org/software/gnutls/ General help  using  GNU  software:
59       http://www.gnu.org/gethelp/
60
62       Copyright © 2008 Free Software Foundation.
63       Copying  and  distribution  of this file, with or without modification,
64       are permitted in any medium  without  royalty  provided  the  copyright
65       notice and this notice are preserved.
66

SEE ALSO

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