Let tkm_keymat_t extend keymat_v2_t
[strongswan.git] / src / charon-tkm / src / tkm / tkm_keymat.h
1 /*
2 * Copyright (C) 2012 Reto Buerki
3 * Copyright (C) 2012 Adrian-Ken Rueegsegger
4 * 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 #ifndef TKM_KEYMAT_H_
18 #define TKM_KEYMAT_H_
19
20 #include <sa/ikev2/keymat_v2.h>
21
22 typedef struct tkm_keymat_t tkm_keymat_t;
23
24 /**
25 * Derivation and management of sensitive keying material, TKM variant.
26 */
27 struct tkm_keymat_t {
28
29 /**
30 * Implements keymat_v2_t.
31 */
32 keymat_v2_t keymat_v2;
33
34 /**
35 * Get ISA context id.
36 *
37 * @return id of associated ISA context.
38 */
39 isa_id_type (*get_isa_id)(tkm_keymat_t * const this);
40
41 /**
42 * Set IKE AUTH payload.
43 *
44 * @param payload AUTH payload
45 */
46 void (*set_auth_payload)(tkm_keymat_t *this, const chunk_t * const payload);
47
48 /**
49 * Get IKE AUTH payload.
50 *
51 * @return AUTH payload if set, chunk_empty otherwise
52 */
53 chunk_t* (*get_auth_payload)(tkm_keymat_t * const this);
54
55 };
56
57 /**
58 * Create TKM keymat instance.
59 *
60 * @param initiator TRUE if we are the initiator
61 * @return keymat instance
62 */
63 tkm_keymat_t *tkm_keymat_create(bool initiator);
64
65 #endif /** KEYMAT_TKM_H_ */