1gnutls_x509_privkey_export2_pkcs8(3)gnutlsgnutls_x509_privkey_export2_pkcs8(3)
2
3
4

NAME

6       gnutls_x509_privkey_export2_pkcs8 - API function
7

SYNOPSIS

9       #include <gnutls/x509.h>
10
11       int     gnutls_x509_privkey_export2_pkcs8(gnutls_x509_privkey_t    key,
12       gnutls_x509_crt_fmt_t format,  const  char  *  password,  unsigned  int
13       flags, gnutls_datum_t * out);
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       gnutls_datum_t * out
29                   will contain a private key PEM or DER encoded
30

DESCRIPTION

32       This  function  will export the private key to a PKCS8 structure.  Both
33       RSA and DSA keys can be exported. For DSA keys we use PKCS  11  defini‐
34       tions.  If the flags do not specify the encryption cipher, then the de‐
35       fault 3DES (PBES2) will be used.
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       The output buffer is allocated using gnutls_malloc().
41
42       If  the  structure  is PEM encoded, it will have a header of "BEGIN EN‐
43       CRYPTED PRIVATE KEY" or "BEGIN PRIVATE KEY" if encryption is not used.
44

RETURNS

46       In case of failure a negative error code will be  returned,  and  0  on
47       success.
48
49       Since 3.1.3
50

REPORTING BUGS

52       Report bugs to <bugs@gnutls.org>.
53       Home page: https://www.gnutls.org
54
55
57       Copyright © 2001- Free Software Foundation, Inc., and others.
58       Copying  and  distribution  of this file, with or without modification,
59       are permitted in any medium without royalty provided the copyright  no‐
60       tice and this notice are preserved.
61

SEE ALSO

63       The  full  documentation  for gnutls is maintained as a Texinfo manual.
64       If the /usr/share/doc/gnutls/ directory does not contain the HTML  form
65       visit
66
67       https://www.gnutls.org/manual/
68
69gnutls                               3.7.2gnutls_x509_privkey_export2_pkcs8(3)
Impressum