- fixed doxygen build
[strongswan.git] / Source / charon / config / credential_store.h
1 /**
2 * @file credential_store.h
3 *
4 * @brief Interface credential_store_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23 #ifndef CREDENTIAL_STORE_H_
24 #define CREDENTIAL_STORE_H_
25
26 #include <types.h>
27 #include <crypto/rsa/rsa_private_key.h>
28 #include <crypto/rsa/rsa_public_key.h>
29
30
31 typedef struct credential_store_t credential_store_t;
32
33 /**
34 * @brief The interface for a credential_store backend.
35 *
36 * @b Constructors:
37 * - stroke_create()
38 *
39 * @ingroup config
40 */
41 struct credential_store_t {
42
43 /**
44 * @brief Returns the preshared secret of a specific ID.
45 *
46 * The returned chunk must be destroyed by the caller after usage.
47 *
48 * @param this calling object
49 * @param identification identification_t object identifiying the secret.
50 * @param[out] preshared_secret the preshared secret will be written there.
51 *
52 * @return
53 * - NOT_FOUND if no preshared secrets for specific ID could be found
54 * - SUCCESS
55 */
56 status_t (*get_shared_secret) (credential_store_t *this, identification_t *identification, chunk_t *preshared_secret);
57
58 /**
59 * @brief Returns the RSA public key of a specific ID.
60 *
61 * The returned rsa_public_key_t must be destroyed by the caller after usage.
62 *
63 * @param this calling object
64 * @param identification identification_t object identifiying the key.
65 * @param[out] public_key the public key will be written there
66 *
67 * @return
68 * - NOT_FOUND if no key is configured for specific id
69 * - SUCCESS
70 */
71 status_t (*get_rsa_public_key) (credential_store_t *this, identification_t *identification, rsa_public_key_t **public_key);
72
73 /**
74 * @brief Returns the RSA private key of a specific ID.
75 *
76 * The returned rsa_private_key_t must be destroyed by the caller after usage.
77 *
78 * @param this calling object
79 * @param identification identification_t object identifiying the key
80 * @param[out] private_key the private key will be written there
81 *
82 * @return
83 * - NOT_FOUND if no key is configured for specific id
84 * - SUCCESS
85 */
86 status_t (*get_rsa_private_key) (credential_store_t *this, identification_t *identification, rsa_private_key_t **private_key);
87
88 /**
89 * @brief Destroys a credential_store_t object.
90 *
91 * @param this calling object
92 */
93 void (*destroy) (credential_store_t *this);
94 };
95
96 #endif /*CREDENTIAL_STORE_H_*/