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
17 * @defgroup stroke_cred stroke_cred
21 #ifndef STROKE_CRED_H_
22 #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
46 * @param prompt I/O channel to prompt for private key passhprase
48 void (*reread
)(stroke_cred_t
*this, stroke_msg_t
*msg
, FILE *prompt
);
51 * Load a CA certificate, and serve it through the credential_set.
53 * @param filename file to load CA cert from
54 * @return reference to loaded certificate, or NULL
56 certificate_t
* (*load_ca
)(stroke_cred_t
*this, char *filename
);
59 * Load a peer certificate and serve it rhrough the credential_set.
61 * @param filename file to load peer cert from
62 * @return reference to loaded certificate, or NULL
64 certificate_t
* (*load_peer
)(stroke_cred_t
*this, char *filename
);
67 * Enable/Disable CRL caching to disk.
69 * @param enabled TRUE to enable, FALSE to disable
71 void (*cachecrl
)(stroke_cred_t
*this, bool enabled
);
74 * Destroy a stroke_cred instance.
76 void (*destroy
)(stroke_cred_t
*this);
80 * Create a stroke_cred instance.
82 stroke_cred_t
*stroke_cred_create();
84 #endif /** STROKE_CRED_H_ @}*/