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 type.
17
18       gnutls_credentials_type_t type
19                   is the type of the credentials
20
21       void * cred the credentials to set
22

DESCRIPTION

24       Sets the needed credentials for the  specified  type.   E.g.  username,
25       password  -  or  public and private keys etc.  The  cred parameter is a
26       structure 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
35       in   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  (0)  is  returned, otherwise a negative
47       error code is returned.
48

REPORTING BUGS

50       Report bugs to <bugs@gnutls.org>.
51       Home page: http://www.gnutls.org
52
53
55       Copyright © 2001-2018 Free Software Foundation, Inc., and others.
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 /usr/share/doc/gnutls/ directory does not contain the HTML form
63       visit
64
65       http://www.gnutls.org/manual/
66
67gnutls                               3.6.5           gnutls_credentials_set(3)
Impressum