updated Doxyfile
[strongswan.git] / src / charon / credentials / sets / cert_cache.h
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * $Id$
16 */
17
18 /**
19 * @defgroup cert_cache cert_cache
20 * @{ @ingroup sets
21 */
22
23 #ifndef CERT_CACHE_H_
24 #define CERT_CACHE_H_
25
26 #include <credentials/credential_set.h>
27
28 typedef struct cert_cache_t cert_cache_t;
29
30 /**
31 * Certificate signature verification and certificate cache.
32 *
33 * This cache serves all certificates seen in its issued_by method
34 * and serves them as untrusted through the credential set interface. Further,
35 * it caches valid subject-issuer relationships to speed up the issued_by
36 * method.
37 */
38 struct cert_cache_t {
39
40 /**
41 * Implements credential_set_t.
42 */
43 credential_set_t set;
44
45 /**
46 * Caching wrapper around certificate_t.issued_by.
47 *
48 * @param subject certificate to verify
49 * @param issuer issuing certificate to verify subject
50 * @return TRUE if subject issued by issuer
51 */
52 bool (*issued_by)(cert_cache_t *this,
53 certificate_t *subject, certificate_t *issuer);
54
55 /**
56 * Flush the certificate cache.
57 *
58 * @param type type of certificate to flush, or CERT_ANY
59 */
60 void (*flush)(cert_cache_t *this, certificate_type_t type);
61
62 /**
63 * Destroy a cert_cache instance.
64 */
65 void (*destroy)(cert_cache_t *this);
66 };
67
68 /**
69 * Create a cert_cache instance.
70 */
71 cert_cache_t *cert_cache_create();
72
73 #endif /** CERT_CACHE_H_ @}*/