1
@node Function reference
2
@chapter Function Reference
3
@cindex Function reference
7
* X.509 certificate functions::
8
* GnuTLS-extra functions::
10
* TLS Inner Application (TLS/IA) functions::
11
* Error codes and descriptions::
15
@section Core Functions
17
The prototypes for the following functions lie in
18
@file{gnutls/gnutls.h}.
20
@include gnutls-api.texi
22
@node X.509 certificate functions
23
@section @acronym{X.509} Certificate Functions
25
@cindex @acronym{X.509} Functions
27
The following functions are to be used for @acronym{X.509} certificate handling.
28
Their prototypes lie in @file{gnutls/x509.h}.
30
@include x509-api.texi
32
@node GnuTLS-extra functions
33
@section @acronym{GnuTLS-extra} Functions
34
@cindex @acronym{GnuTLS-extra} functions
36
These functions are only available in the GPLv3+ version of the
37
library called @code{gnutls-extra}. The prototypes for this library
38
lie in @file{gnutls/extra.h}.
40
@include extra-api.texi
42
@node OpenPGP functions
43
@section @acronym{OpenPGP} Functions
44
@cindex @acronym{OpenPGP} functions
45
@anchor{sec:openpgpapi}
47
The following functions are to be used for @acronym{OpenPGP}
48
certificate handling. Their prototypes lie in
49
@file{gnutls/openpgp.h}.
53
@node TLS Inner Application (TLS/IA) functions
54
@section @acronym{TLS} Inner Application (@acronym{TLS/IA}) Functions
55
@cindex @acronym{TLS} Inner Application (@acronym{TLS/IA}) functions
56
@cindex Inner Application (@acronym{TLS/IA}) functions
58
The following functions are used for @acronym{TLS} Inner Application
59
(@acronym{TLS/IA}). Their prototypes lie in @file{gnutls/extra.h}.
60
You need to link with @file{libgnutls-extra} to be able to use these
61
functions (@pxref{GnuTLS-extra functions}).
63
The typical control flow in an TLS/IA client (that would not require
64
an Application Phase for resumed sessions) would be similar to the
68
int client_avp (gnuls_session_t *session, void *ptr,
69
const char *last, size_t lastlen,
70
char **new, size_t *newlen)
77
gnutls_ia_client_credentials_t iacred;
79
gnutls_init (&session, GNUTLS_CLIENT);
82
gnutls_ia_allocate_client_credentials(&iacred);
83
gnutls_ia_set_client_avp_function(iacred, client_avp);
84
gnutls_credentials_set (session, GNUTLS_CRD_IA, iacred);
86
ret = gnutls_handshake (session);
89
if (gnutls_ia_handshake_p (session))
91
ret = gnutls_ia_handshake (session);
96
See below for detailed descriptions of all the functions used above.
98
The function @code{client_avp} would have to be implemented by your
99
application. The function is responsible for handling the AVP data.
100
See @code{gnutls_ia_set_client_avp_function} below for more
101
information on how that function should be implemented.
103
The control flow in a typical server is similar to the above, use
104
@code{gnutls_ia_server_credentials_t} instead of
105
@code{gnutls_ia_client_credentials_t}, and replace the call to the
106
client functions with the corresponding server functions.
110
@node Error codes and descriptions
111
@section Error Codes and Descriptions
115
The error codes used throughout the library are described below. The
116
return code @code{GNUTLS_E_SUCCESS} indicate successful operation, and
117
is guaranteed to have the value 0, so you can use it in logical
120
@include error_codes.texi