Annotation of embedaddon/strongswan/src/libcharon/plugins/stroke/stroke_cred.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * Copyright (C) 2012 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_cred stroke_cred
                     19:  * @{ @ingroup stroke
                     20:  */
                     21: 
                     22: #ifndef STROKE_CRED_H_
                     23: #define STROKE_CRED_H_
                     24: 
                     25: #include <stdio.h>
                     26: 
                     27: #include <stroke_msg.h>
                     28: #include <credentials/credential_set.h>
                     29: #include <credentials/certificates/certificate.h>
                     30: #include <collections/linked_list.h>
                     31: 
                     32: #include "stroke_ca.h"
                     33: 
                     34: typedef struct stroke_cred_t stroke_cred_t;
                     35: 
                     36: /**
                     37:  * Stroke in-memory credential storage.
                     38:  */
                     39: struct stroke_cred_t {
                     40: 
                     41:        /**
                     42:         * Implements credential_set_t
                     43:         */
                     44:        credential_set_t set;
                     45: 
                     46:        /**
                     47:         * Reread secrets from config files.
                     48:         *
                     49:         * @param msg           stroke message
                     50:         * @param prompt        I/O channel to prompt for private key passphrase
                     51:         */
                     52:        void (*reread)(stroke_cred_t *this, stroke_msg_t *msg, FILE *prompt);
                     53: 
                     54:        /**
                     55:         * Load a peer certificate and serve it through the credential_set.
                     56:         *
                     57:         * @param filename              file to load peer cert from
                     58:         * @return                              reference to loaded certificate, or NULL
                     59:         */
                     60:        certificate_t* (*load_peer)(stroke_cred_t *this, char *filename);
                     61: 
                     62:        /**
                     63:         * Load a raw public key and serve it through the credential_set.
                     64:         *
                     65:         * @param filename              encoding or file to load raw public key from
                     66:         * @param identity              identity of the raw public key owner
                     67:         * @return                              reference to loaded raw public key, or NULL
                     68:         */
                     69:        certificate_t* (*load_pubkey)(stroke_cred_t *this, char *filename,
                     70:                                                                  identification_t *identity);
                     71: 
                     72:        /**
                     73:         * Add a shared secret to serve through the credential_set.
                     74:         *
                     75:         * @param shared                shared key to add, gets owned
                     76:         * @param owners                list of owners (identification_t*), gets owned
                     77:         */
                     78:        void (*add_shared)(stroke_cred_t *this, shared_key_t *shared,
                     79:                                           linked_list_t *owners);
                     80: 
                     81:        /**
                     82:         * Enable/Disable CRL caching to disk.
                     83:         *
                     84:         * @param enabled               TRUE to enable, FALSE to disable
                     85:         */
                     86:        void (*cachecrl)(stroke_cred_t *this, bool enabled);
                     87: 
                     88:        /**
                     89:         * Destroy a stroke_cred instance.
                     90:         */
                     91:        void (*destroy)(stroke_cred_t *this);
                     92: };
                     93: 
                     94: /**
                     95:  * Create a stroke_cred instance.
                     96:  */
                     97: stroke_cred_t *stroke_cred_create(stroke_ca_t *ca);
                     98: 
                     99: #endif /** STROKE_CRED_H_ @}*/

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>