1gnutls_certificate_set_key(3)       gnutls       gnutls_certificate_set_key(3)
2
3
4

NAME

6       gnutls_certificate_set_key - API function
7

SYNOPSIS

9       #include <gnutls/abstract.h>
10
11       int   gnutls_certificate_set_key(gnutls_certificate_credentials_t  res,
12       const char ** names, int names_size, gnutls_pcert_st * pcert_list,  int
13       pcert_list_size, gnutls_privkey_t key);
14

ARGUMENTS

16       gnutls_certificate_credentials_t res
17                   is a gnutls_certificate_credentials_t type.
18
19       const char ** names
20                   is an array of DNS name of the certificate (NULL if none)
21
22       int names_size
23                   holds the size of the names list
24
25       gnutls_pcert_st * pcert_list
26                   contains  a  certificate list (path) for the specified pri‐
27                   vate key
28
29       int pcert_list_size
30                   holds the size of the certificate list
31
32       gnutls_privkey_t key
33                   is a gnutls_privkey_t key
34

DESCRIPTION

36       This function sets a certificate/private key pair  in  the  gnutls_cer‐
37       tificate_credentials_t  type.   This  function  may be called more than
38       once, in case multiple keys/certificates exist  for  the  server.   For
39       clients  that  want to send more than their own end- entity certificate
40       (e.g., also an intermediate CA cert), the full certificate  chain  must
41       be provided in  pcert_list .
42
43       Note  that the  key and the elements of  pcert_list will become part of
44       the credentials structure and must not be  deallocated.  They  will  be
45       automatically deallocated when the  res structure is deinitialized.
46
47       If  that  function  fails to load the  res structure is at an undefined
48       state, it must not be reused to load other keys or certificates.
49
50       Note that, this function by default returns zero on success and a nega‐
51       tive  value  on  error.   Since  3.5.6,  when  the flag GNUTLS_CERTIFI‐
52       CATE_API_V2 is set using gnutls_certificate_set_flags() it  returns  an
53       index (greater or equal to zero). That index can be used to other func‐
54       tions to refer to the added key-pair.
55

RETURNS

57       On success this functions returns zero, and otherwise a negative  value
58       on error (see above for modifying that behavior).
59

SINCE

61       3.0
62

REPORTING BUGS

64       Report bugs to <bugs@gnutls.org>.
65       Home page: http://www.gnutls.org
66
67
69       Copyright © 2001-2018 Free Software Foundation, Inc., and others.
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.6.5       gnutls_certificate_set_key(3)
Impressum