1 .\" DO NOT MODIFY THIS FILE! It was generated by gdoc.
2 .TH "gnutls_credentials_set" 3 "2.12.6.1" "gnutls" "gnutls"
4 gnutls_credentials_set \- API function
6 .B #include <gnutls/gnutls.h>
8 .BI "int gnutls_credentials_set(gnutls_session_t " session ", gnutls_credentials_type_t " type ", void * " cred ");"
10 .IP "gnutls_session_t session" 12
11 is a \fBgnutls_session_t\fP structure.
12 .IP "gnutls_credentials_type_t type" 12
13 is the type of the credentials
15 is a pointer to a structure.
17 Sets the needed credentials for the specified type. Eg username,
18 password \- or public and private keys etc. The \fIcred\fP parameter is
19 a structure that depends on the specified type and on the current
20 session (client or server).
22 In order to minimize memory usage, and share credentials between
23 several threads gnutls keeps a pointer to cred, and not the whole
24 cred structure. Thus you will have to keep the structure allocated
25 until you call \fBgnutls_deinit()\fP.
27 For \fBGNUTLS_CRD_ANON\fP, \fIcred\fP should be
28 \fBgnutls_anon_client_credentials_t\fP in case of a client. In case of
29 a server it should be \fBgnutls_anon_server_credentials_t\fP.
31 For \fBGNUTLS_CRD_SRP\fP, \fIcred\fP should be \fBgnutls_srp_client_credentials_t\fP
32 in case of a client, and \fBgnutls_srp_server_credentials_t\fP, in case
35 For \fBGNUTLS_CRD_CERTIFICATE\fP, \fIcred\fP should be
36 \fBgnutls_certificate_credentials_t\fP.
38 On success, \fBGNUTLS_E_SUCCESS\fP (zero) is returned,
39 otherwise an error code is returned.
41 Report bugs to <bug-gnutls@gnu.org>.
42 GnuTLS home page: http://www.gnu.org/software/gnutls/
43 General help using GNU software: http://www.gnu.org/gethelp/
45 Copyright \(co 2008 Free Software Foundation.
47 Copying and distribution of this file, with or without modification,
48 are permitted in any medium without royalty provided the copyright
49 notice and this notice are preserved.
51 The full documentation for
53 is maintained as a Texinfo manual. If the
57 programs are properly installed at your site, the command
61 should give you access to the complete manual.