Blame doc/functions/gnutls_psk_set_server_credentials_function

Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
@deftypefun {void} {gnutls_psk_set_server_credentials_function} (gnutls_psk_server_credentials_t         @var{cred}, gnutls_psk_server_credentials_function         * @var{func})
Packit aea12f
@var{cred}: is a @code{gnutls_psk_server_credentials_t}  type.
Packit aea12f
Packit aea12f
@var{func}: is the callback function
Packit aea12f
Packit aea12f
This function can be used to set a callback to retrieve the user's PSK credentials.
Packit aea12f
The callback's function form is:
Packit aea12f
int (*callback)(gnutls_session_t, const char* username,
Packit aea12f
gnutls_datum_t* key);
Packit aea12f
Packit aea12f
 @code{username} contains the actual username.
Packit aea12f
The  @code{key} must be filled in using the @code{gnutls_malloc()} .
Packit aea12f
Packit aea12f
In case the callback returned a negative number then gnutls will
Packit aea12f
assume that the username does not exist.
Packit aea12f
Packit aea12f
The callback function will only be called once per handshake.  The
Packit aea12f
callback function should return 0 on success, while -1 indicates
Packit aea12f
an error.
Packit aea12f
@end deftypefun