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

RETURNS

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

REPORTING BUGS

57       Report bugs to <bugs@gnutls.org>.
58       Home page: https://www.gnutls.org
59
60
62       Copyright © 2001- Free Software Foundation, Inc., and others.
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 /usr/share/doc/gnutls/ directory does not contain the HTML  form
70       visit
71
72       https://www.gnutls.org/manual/
73
74gnutls                              3.6.15 gnutls_x509_privkey_export_pkcs8(3)
Impressum