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

NAME

6       gnutls_credentials_set  - Sets the needed credentials for the specified
7       authentication algorithm.
8

SYNOPSIS

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

ARGUMENTS

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

DESCRIPTION

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

RETURNS

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

REPORTING BUGS

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

SEE ALSO

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