1gnutls_certificate_set_retrieve_funcgtgninuoutntl(ls3s_)certificate_set_retrieve_function(3)
2
3
4
6 gnutls_certificate_set_retrieve_function - API function
7
9 #include <gnutls/gnutls.h>
10
11 void gnutls_certificate_set_retrieve_function(gnutls_certificate_cre‐
12 dentials_t cred, gnutls_certificate_retrieve_function * func);
13
15 gnutls_certificate_credentials_t cred
16 is a gnutls_certificate_credentials_t type.
17
18 gnutls_certificate_retrieve_function * func
19 is the callback function
20
22 This function sets a callback to be called in order to retrieve the
23 certificate to be used in the handshake. The callback will take control
24 only if a certificate is requested by the peer. You are advised to use
25 gnutls_certificate_set_retrieve_function2() because it is much more ef‐
26 ficient in the processing it requires from gnutls.
27
28 The callback's function prototype is: int (*callback)(gnutls_session_t,
29 const gnutls_datum_t* req_ca_dn, int nreqs, const gnutls_pk_algo‐
30 rithm_t* pk_algos, int pk_algos_length, gnutls_retr2_st* st);
31
32 req_ca_dn is only used in X.509 certificates. Contains a list with
33 the CA names that the server considers trusted. This is a hint and
34 typically the client should send a certificate that is signed by one of
35 these CAs. These names, when available, are DER encoded. To get a more
36 meaningful value use the function gnutls_x509_rdn_get().
37
38 pk_algos contains a list with server's acceptable public key algo‐
39 rithms. The certificate returned should support the server's given al‐
40 gorithms.
41
42 st should contain the certificates and private keys.
43
44 If the callback function is provided then gnutls will call it, in the
45 handshake, after the certificate request message has been received.
46
47 In server side pk_algos and req_ca_dn are NULL.
48
49 The callback function should set the certificate list to be sent, and
50 return 0 on success. If no certificate was selected then the number of
51 certificates should be set to zero. The value (-1) indicates error and
52 the handshake will be terminated. If both certificates are set in the
53 credentials and a callback is available, the callback takes predence.
54
56 3.0
57
59 Report bugs to <bugs@gnutls.org>.
60 Home page: https://www.gnutls.org
61
62
64 Copyright © 2001-2023 Free Software Foundation, Inc., and others.
65 Copying and distribution of this file, with or without modification,
66 are permitted in any medium without royalty provided the copyright no‐
67 tice and this notice are preserved.
68
70 The full documentation for gnutls is maintained as a Texinfo manual.
71 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
72 visit
73
74 https://www.gnutls.org/manual/
75
76gnutls gn3u.t8l.s2_certificate_set_retrieve_function(3)