1gnutls_credentials_set(3)           gnutls           gnutls_credentials_set(3)
2
3
4

NAME

6       gnutls_credentials_set - API function
7

SYNOPSIS

9       #include <gnutls/gnutls.h>
10
11       int   gnutls_credentials_set(gnutls_session_t  session,  gnutls_creden‐
12       tials_type_t type, void * cred);
13

ARGUMENTS

15       gnutls_session_t session
16                   is a gnutls_session_t structure.
17
18       gnutls_credentials_type_t type
19                   is the type of the credentials
20
21       void * cred is a pointer to a structure.
22

DESCRIPTION

24       Sets the needed credentials for the specified type.  Eg username, pass‐
25       word  - or public and private keys etc.  The cred parameter is a struc‐
26       ture that depends on the specified type  and  on  the  current  session
27       (client or server).
28
29       In  order  to minimize memory usage, and share credentials between sev‐
30       eral threads gnutls keeps a pointer to cred, and  not  the  whole  cred
31       structure.   Thus  you  will have to keep the structure allocated until
32       you call gnutls_deinit().
33
34       For GNUTLS_CRD_ANON, cred should be gnutls_anon_client_credentials_t in
35       case   of   a   client.    In   case   of   a   server   it  should  be
36       gnutls_anon_server_credentials_t.
37
38       For GNUTLS_CRD_SRP, cred should be  gnutls_srp_client_credentials_t  in
39       case  of  a  client,  and gnutls_srp_server_credentials_t, in case of a
40       server.
41
42       For GNUTLS_CRD_CERTIFICATE, cred should  be  gnutls_certificate_creden‐
43       tials_t.
44

RETURNS

46       On  success,  GNUTLS_E_SUCCESS  (zero)  is returned, otherwise an error
47       code is returned.
48

REPORTING BUGS

50       Report   bugs   to    <bug-gnutls@gnu.org>.     GnuTLS    home    page:
51       http://www.gnu.org/software/gnutls/  General  help  using GNU software:
52       http://www.gnu.org/gethelp/
53
55       Copyright © 2008 Free Software Foundation.
56       Copying and distribution of this file, with  or  without  modification,
57       are  permitted  in  any  medium  without royalty provided the copyright
58       notice and this notice are preserved.
59

SEE ALSO

61       The full documentation for gnutls is maintained as  a  Texinfo  manual.
62       If  the  info  and gnutls programs are properly installed at your site,
63       the command
64
65              info gnutls
66
67       should give you access to the complete manual.
68
69
70
71gnutls                             2.12.6.1          gnutls_credentials_set(3)
Impressum