Tizen 2.0 Release
[external/libgnutls26.git] / doc / manpages / gnutls_credentials_set.3
1 .\" DO NOT MODIFY THIS FILE!  It was generated by gdoc.
2 .TH "gnutls_credentials_set" 3 "2.12.6.1" "gnutls" "gnutls"
3 .SH NAME
4 gnutls_credentials_set \- API function
5 .SH SYNOPSIS
6 .B #include <gnutls/gnutls.h>
7 .sp
8 .BI "int gnutls_credentials_set(gnutls_session_t " session ", gnutls_credentials_type_t " type ", void * " cred ");"
9 .SH ARGUMENTS
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
14 .IP "void * cred" 12
15 is a pointer to a structure.
16 .SH "DESCRIPTION"
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).
21
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.
26
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.
30
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
33 of a server.
34
35 For \fBGNUTLS_CRD_CERTIFICATE\fP, \fIcred\fP should be
36 \fBgnutls_certificate_credentials_t\fP.
37 .SH "RETURNS"
38 On success, \fBGNUTLS_E_SUCCESS\fP (zero) is returned,
39 otherwise an error code is returned.
40 .SH "REPORTING BUGS"
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/
44 .SH COPYRIGHT
45 Copyright \(co 2008 Free Software Foundation.
46 .br
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.
50 .SH "SEE ALSO"
51 The full documentation for
52 .B gnutls
53 is maintained as a Texinfo manual.  If the
54 .B info
55 and
56 .B gnutls
57 programs are properly installed at your site, the command
58 .IP
59 .B info gnutls
60 .PP
61 should give you access to the complete manual.