certtool is able to set certificate policies via a template
[gnutls.git] / lib / gnutls_auth.h
blobfe367e8bdf8a362597ad3da2e41f8941d9d34b8f
1 /*
2 * Copyright (C) 2000-2012 Free Software Foundation, Inc.
4 * Author: Nikos Mavrogiannopoulos
6 * This file is part of GnuTLS.
8 * The GnuTLS is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>
23 #ifndef GNUTLS_AUTH_H
24 #define GNUTLS_AUTH_H
26 #include <gnutls_str.h>
28 typedef struct mod_auth_st_int
30 const char *name; /* null terminated */
31 int (*gnutls_generate_server_certificate) (gnutls_session_t, gnutls_buffer_st*);
32 int (*gnutls_generate_client_certificate) (gnutls_session_t, gnutls_buffer_st*);
33 int (*gnutls_generate_server_kx) (gnutls_session_t, gnutls_buffer_st*);
34 int (*gnutls_generate_client_kx) (gnutls_session_t, gnutls_buffer_st*); /* used in SRP */
35 int (*gnutls_generate_client_crt_vrfy) (gnutls_session_t, gnutls_buffer_st *);
36 int (*gnutls_generate_server_crt_request) (gnutls_session_t,
37 gnutls_buffer_st *);
39 int (*gnutls_process_server_certificate) (gnutls_session_t, uint8_t *,
40 size_t);
41 int (*gnutls_process_client_certificate) (gnutls_session_t, uint8_t *,
42 size_t);
43 int (*gnutls_process_server_kx) (gnutls_session_t, uint8_t *, size_t);
44 int (*gnutls_process_client_kx) (gnutls_session_t, uint8_t *, size_t);
45 int (*gnutls_process_client_crt_vrfy) (gnutls_session_t, uint8_t *, size_t);
46 int (*gnutls_process_server_crt_request) (gnutls_session_t,
47 uint8_t *, size_t);
48 } mod_auth_st;
50 const void *_gnutls_get_cred (gnutls_session_t session,
51 gnutls_credentials_type_t kx, int *err);
52 const void *_gnutls_get_kx_cred (gnutls_session_t session,
53 gnutls_kx_algorithm_t algo, int *err);
54 void *_gnutls_get_auth_info (gnutls_session_t session);
55 int _gnutls_auth_info_set (gnutls_session_t session,
56 gnutls_credentials_type_t type, int size,
57 int allow_change);
59 #endif