2 * Copyright (C) 2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
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>.
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
19 * @defgroup stroke_cred stroke_cred
23 #ifndef STROKE_CRED_H_
24 #define STROKE_CRED_H_
26 #include <stroke_msg.h>
27 #include <credentials/credential_set.h>
28 #include <credentials/certificates/certificate.h>
30 typedef struct stroke_cred_t stroke_cred_t
;
33 * Stroke in-memory credential storage.
35 struct stroke_cred_t
{
38 * Implements credential_set_t
43 * Reread secrets from config files.
45 * @param msg stroke message
47 void (*reread
)(stroke_cred_t
*this, stroke_msg_t
*msg
);
50 * Load a CA certificate, and serve it through the credential_set.
52 * @param filename file to load CA cert from
53 * @return reference to loaded certificate, or NULL
55 certificate_t
* (*load_ca
)(stroke_cred_t
*this, char *filename
);
58 * Load a peer certificate and serve it rhrough the credential_set.
60 * @param filename file to load peer cert from
61 * @return reference to loaded certificate, or NULL
63 certificate_t
* (*load_peer
)(stroke_cred_t
*this, char *filename
);
66 * Destroy a stroke_cred instance.
68 void (*destroy
)(stroke_cred_t
*this);
72 * Create a stroke_cred instance.
74 stroke_cred_t
*stroke_cred_create();
76 #endif /* STROKE_CRED_H_ @}*/