added -avoid-version to LDFLAGS, plugins are not versioned
[strongswan.git] / src / charon / plugins / stroke / stroke_cred.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
16 /**
17 * @defgroup stroke_cred stroke_cred
18 * @{ @ingroup stroke
19 */
20
21 #ifndef STROKE_CRED_H_
22 #define STROKE_CRED_H_
23
24 #include <stroke_msg.h>
25 #include <credentials/credential_set.h>
26 #include <credentials/certificates/certificate.h>
27
28 typedef struct stroke_cred_t stroke_cred_t;
29
30 /**
31 * Stroke in-memory credential storage.
32 */
33 struct stroke_cred_t {
34
35 /**
36 * Implements credential_set_t
37 */
38 credential_set_t set;
39
40 /**
41 * Reread secrets from config files.
42 *
43 * @param msg stroke message
44 */
45 void (*reread)(stroke_cred_t *this, stroke_msg_t *msg);
46
47 /**
48 * Load a CA certificate, and serve it through the credential_set.
49 *
50 * @param filename file to load CA cert from
51 * @return reference to loaded certificate, or NULL
52 */
53 certificate_t* (*load_ca)(stroke_cred_t *this, char *filename);
54
55 /**
56 * Load a peer certificate and serve it rhrough the credential_set.
57 *
58 * @param filename file to load peer cert from
59 * @return reference to loaded certificate, or NULL
60 */
61 certificate_t* (*load_peer)(stroke_cred_t *this, char *filename);
62
63 /**
64 * Enable/Disable CRL caching to disk.
65 *
66 * @param enabled TRUE to enable, FALSE to disable
67 */
68 void (*cachecrl)(stroke_cred_t *this, bool enabled);
69
70 /**
71 * Destroy a stroke_cred instance.
72 */
73 void (*destroy)(stroke_cred_t *this);
74 };
75
76 /**
77 * Create a stroke_cred instance.
78 */
79 stroke_cred_t *stroke_cred_create();
80
81 #endif /** STROKE_CRED_H_ @}*/