1gnutls_psk_set_server_credentials_gfnuungtcnltusit_olpnss(k3_)set_server_credentials_function(3)
2
3
4
6 gnutls_psk_set_server_credentials_function - API function
7
9 #include <gnutls/gnutls.h>
10
11 void gnutls_psk_set_server_credentials_function(gnutls_psk_server_cre‐
12 dentials_t cred, gnutls_psk_server_credentials_function * func);
13
15 gnutls_psk_server_credentials_t cred
16 is a gnutls_psk_server_credentials_t type.
17
18 gnutls_psk_server_credentials_function * func
19 is the callback function
20
22 This function can be used to set a callback to retrieve the user's PSK
23 credentials. The callback's function form is: int (*call‐
24 back)(gnutls_session_t, const char* username, gnutls_datum_t* key);
25
26 username contains the actual username. The key must be filled in us‐
27 ing the gnutls_malloc().
28
29 In case the callback returned a negative number then gnutls will assume
30 that the username does not exist.
31
32 The callback function will only be called once per handshake. The
33 callback function should return 0 on success, while -1 indicates an er‐
34 ror.
35
37 Report bugs to <bugs@gnutls.org>.
38 Home page: https://www.gnutls.org
39
40
42 Copyright © 2001-2023 Free Software Foundation, Inc., and others.
43 Copying and distribution of this file, with or without modification,
44 are permitted in any medium without royalty provided the copyright no‐
45 tice and this notice are preserved.
46
48 The full documentation for gnutls is maintained as a Texinfo manual.
49 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
50 visit
51
52 https://www.gnutls.org/manual/
53
54gnutls gnut3l.s8_.p2sk_set_server_credentials_function(3)