1gnutls_certificate_set_x509_key_file2g(n3ug)tnlustls_certificate_set_x509_key_file2(3)
2
3
4

NAME

6       gnutls_certificate_set_x509_key_file2 - API function
7

SYNOPSIS

9       #include <gnutls/gnutls.h>
10
11       int    gnutls_certificate_set_x509_key_file2(gnutls_certificate_creden‐
12       tials_t  res,  const  char  *   certfile,   const   char   *   keyfile,
13       gnutls_x509_crt_fmt_t type, const char * pass, unsigned int flags);
14

ARGUMENTS

16       gnutls_certificate_credentials_t res
17                   is a gnutls_certificate_credentials_t structure.
18
19       const char * certfile
20                   is  a  file that containing the certificate list (path) for
21                   the specified private key, in PKCS7 format, or  a  list  of
22                   certificates
23
24       const char * keyfile
25                   is a file that contains the private key
26
27       gnutls_x509_crt_fmt_t type
28                   is PEM or DER
29
30       const char * pass
31                   is the password of the key
32
33       unsigned int flags
34                   an ORed sequence of gnutls_pkcs_encrypt_flags_t
35

DESCRIPTION

37       This  function  sets  a certificate/private key pair in the gnutls_cer‐
38       tificate_credentials_t structure.  This function  may  be  called  more
39       than  once,  in  case  multiple keys/certificates exist for the server.
40       For clients that need to send more than its own end entity certificate,
41       e.g., also an intermediate CA cert, then the
42        certfile must contain the ordered certificate chain.
43
44       Note that the names in the certificate provided will be considered when
45       selecting the appropriate certificate to use (in case of multiple  cer‐
46       tificate/key pairs).
47
48       This  function can also accept URLs at  keyfile and  certfile . In that
49       case it will import the private key and certificate  indicated  by  the
50       URLs.   Note  that  the  supported  URLs  are  the  ones  indicated  by
51       gnutls_url_is_supported().
52
53       In case the  certfile is provided as a PKCS 11 URL, then  the  certifi‐
54       cate,  and its present issuers in the token are are imported (i.e., the
55       required trust chain).
56
57       If that function fails to load the  res structure is  at  an  undefined
58       state, it must not be reused to load other keys or certificates.
59

RETURNS

61       GNUTLS_E_SUCCESS (0) on success, or a negative error code.
62

REPORTING BUGS

64       Report bugs to <bugs@gnutls.org>.
65       Home page: http://www.gnutls.org
66
67
69       Copyright © 2001-2014 Free Software Foundation, Inc..
70       Copying  and  distribution  of this file, with or without modification,
71       are permitted in any medium  without  royalty  provided  the  copyright
72       notice and this notice are preserved.
73

SEE ALSO

75       The  full  documentation  for gnutls is maintained as a Texinfo manual.
76       If the /usr/share/doc/gnutls/ directory does not contain the HTML  form
77       visit
78
79       http://www.gnutls.org/manual/
80
81gnutls                              3.3g.n2u9tls_certificate_set_x509_key_file2(3)
Impressum