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

NAME

6       gnutls_x509_privkey_export_pkcs8 - API function
7

SYNOPSIS

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

ARGUMENTS

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

DESCRIPTION

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

RETURN VALUE

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

REPORTING BUGS

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

SEE ALSO

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