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_shared_key stroke_shared_key
23 #ifndef STROKE_SHARED_KEY_H_
24 #define STROKE_SHARED_KEY_H_
26 #include <utils/identification.h>
27 #include <credentials/keys/shared_key.h>
29 typedef struct stroke_shared_key_t stroke_shared_key_t
;
32 * Shared key implementation for keys read from ipsec.secrets
34 struct stroke_shared_key_t
{
37 * Implements the shared_key_t interface.
42 * Add an owner to the key.
44 * @param owner owner to add
46 void (*add_owner
)(stroke_shared_key_t
*this, identification_t
*owner
);
49 * Check if a key has a specific owner.
51 * @param owner owner to check
52 * @return best match found
54 id_match_t (*has_owner
)(stroke_shared_key_t
*this, identification_t
*owner
);
58 * Create a stroke_shared_key instance.
60 stroke_shared_key_t
*stroke_shared_key_create(shared_key_type_t type
, chunk_t key
);
62 #endif /* STROKE_SHARED_KEY_H_ @}*/