1gnutls_certificate_set_retrieve_fungcntguintoulnts2l_(sc3e)rtificate_set_retrieve_function2(3)
2
3
4

NAME

6       gnutls_certificate_set_retrieve_function2 - API function
7

SYNOPSIS

9       #include <gnutls/abstract.h>
10
11       void  gnutls_certificate_set_retrieve_function2(gnutls_certificate_cre‐
12       dentials_t cred, gnutls_certificate_retrieve_function2 * func);
13

ARGUMENTS

15       gnutls_certificate_credentials_t cred
16                   is a gnutls_certificate_credentials_t structure.
17
18       gnutls_certificate_retrieve_function2 * func
19                   is the callback function
20

DESCRIPTION

22       This function sets a callback to be called in  order  to  retrieve  the
23       certificate to be used in the handshake.
24
25       The callback's function prototype is: int (*callback)(gnutls_session_t,
26       const  gnutls_datum_t*  req_ca_dn,  int  nreqs,  const  gnutls_pk_algo‐
27       rithm_t*   pk_algos,   int  pk_algos_length,  gnutls_pcert_st**  pcert,
28       unsigned int *pcert_length, gnutls_privkey_t * pkey);
29
30        req_ca_dn is only used in X.509 certificates.  Contains  a  list  with
31       the  CA  names  that  the server considers trusted.  Normally we should
32       send a certificate that is signed by one of these CAs. These names  are
33       DER   encoded.  To  get  a  more  meaningful  value  use  the  function
34       gnutls_x509_rdn_get().
35
36        pk_algos contains a list  with  server's  acceptable  signature  algo‐
37       rithms.   The  certificate  returned  should support the server's given
38       algorithms.
39
40        pcert should contain a single certificate and public key or a list  of
41       them.
42
43        pcert_length is the size of the previous list.
44
45        pkey is the private key.
46
47       If  the  callback function is provided then gnutls will call it, in the
48       handshake, after the certificate request  message  has  been  received.
49       All  the  provided by the callback values will not be released or modi‐
50       fied by gnutls.
51
52       In server side pk_algos and req_ca_dn are NULL.
53
54       The callback function should set the certificate list to be  sent,  and
55       return  0 on success. If no certificate was selected then the number of
56       certificates should be set to zero. The value (-1) indicates error  and
57       the handshake will be terminated.
58

SINCE

60       3.0
61

REPORTING BUGS

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

SEE ALSO

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