]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/charon-tkm/src/tkm/tkm_diffie_hellman.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / charon-tkm / src / tkm / tkm_diffie_hellman.h
1 /*
2 * Copyright (C) 2012 Reto Buerki
3 * Copyright (C) 2012 Adrian-Ken Rueegsegger
4 *
5 * Copyright (C) secunet Security Networks AG
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 */
17
18 /**
19 * @defgroup tkm-dh diffie hellman
20 * @{ @ingroup tkm
21 */
22
23 #ifndef TKM_DIFFIE_HELLMAN_H_
24 #define TKM_DIFFIE_HELLMAN_H_
25
26 typedef struct tkm_diffie_hellman_t tkm_diffie_hellman_t;
27
28 #include <library.h>
29 #include <tkm/types.h>
30
31 /**
32 * diffie_hellman_t implementation using the trusted key manager.
33 */
34 struct tkm_diffie_hellman_t {
35
36 /**
37 * Implements diffie_hellman_t interface.
38 */
39 diffie_hellman_t dh;
40
41 /**
42 * Get Diffie-Hellman context id.
43 *
44 * @return id of this DH context.
45 */
46 dh_id_type (*get_id)(tkm_diffie_hellman_t * const this);
47
48 };
49
50 /**
51 * Loads IANA DH group identifier to TKM id mapping from config and registers
52 * the corresponding DH features.
53 *
54 * @return number of registered mappings
55 */
56 int register_dh_mapping();
57
58 /**
59 * Destroy IANA DH group identifier to TKM id mapping.
60 */
61 void destroy_dh_mapping();
62
63 /**
64 * Creates a new tkm_diffie_hellman_t object.
65 *
66 * @param group Diffie Hellman group number to use
67 * @return tkm_diffie_hellman_t object, NULL if not supported
68 */
69 tkm_diffie_hellman_t *tkm_diffie_hellman_create(diffie_hellman_group_t group);
70
71 #endif /** TKM_DIFFIE_HELLMAN_H_ @}*/