Return to stroke_ca.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / libcharon / plugins / stroke |
1.1 misho 1: /* 2: * Copyright (C) 2008-2015 Tobias Brunner 3: * Copyright (C) 2008 Martin Willi 4: * HSR Hochschule fuer Technik Rapperswil 5: * 6: * This program is free software; you can redistribute it and/or modify it 7: * under the terms of the GNU General Public License as published by the 8: * Free Software Foundation; either version 2 of the License, or (at your 9: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. 10: * 11: * This program is distributed in the hope that it will be useful, but 12: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14: * for more details. 15: */ 16: 17: /** 18: * @defgroup stroke_ca stroke_ca 19: * @{ @ingroup stroke 20: */ 21: 22: #ifndef STROKE_CA_H_ 23: #define STROKE_CA_H_ 24: 25: #include <stroke_msg.h> 26: #include <credentials/sets/mem_cred.h> 27: 28: typedef struct stroke_ca_t stroke_ca_t; 29: 30: /** 31: * ipsec.conf ca section handling. 32: */ 33: struct stroke_ca_t { 34: 35: /** 36: * Implements credential_set_t 37: */ 38: credential_set_t set; 39: 40: /** 41: * Add a CA to the set using a stroke_msg_t. 42: * 43: * @param msg stroke message containing CA info 44: */ 45: void (*add)(stroke_ca_t *this, stroke_msg_t *msg); 46: 47: /** 48: * Remove a CA from the set using a stroke_msg_t. 49: * 50: * @param msg stroke message containing CA info 51: */ 52: void (*del)(stroke_ca_t *this, stroke_msg_t *msg); 53: 54: /** 55: * List CA sections to stroke console. 56: * 57: * @param msg stroke message 58: */ 59: void (*list)(stroke_ca_t *this, stroke_msg_t *msg, FILE *out); 60: 61: /** 62: * Get a reference to a CA certificate if it is already stored, 63: * otherwise returns the same certificate. 64: * 65: * @param cert certificate to check 66: * @return reference to stored CA certificate, or original 67: */ 68: certificate_t *(*get_cert_ref)(stroke_ca_t *this, certificate_t *cert); 69: 70: /** 71: * Reload CA certificates referenced in CA sections. Flushes the certificate 72: * cache. 73: */ 74: void (*reload_certs)(stroke_ca_t *this); 75: 76: /** 77: * Replace automatically loaded CA certificates. Flushes the certificate 78: * cache. 79: * 80: * @param certs credential set to take certificates from (not modified) 81: */ 82: void (*replace_certs)(stroke_ca_t *this, mem_cred_t *certs); 83: 84: /** 85: * Destroy a stroke_ca instance. 86: */ 87: void (*destroy)(stroke_ca_t *this); 88: }; 89: 90: /** 91: * Create a stroke_ca instance. 92: */ 93: stroke_ca_t *stroke_ca_create(); 94: 95: #endif /** STROKE_CA_H_ @}*/