Implemented Diffie Hellman Nonce attributes
[strongswan.git] / src / libpts / tcg / tcg_pts_attr_dh_nonce_params_resp.h
1 /*
2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
4 *
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>.
9 *
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
13 * for more details.
14 */
15
16 /**
17 * @defgroup tcg_pts_attr_dh_nonce_params_resp tcg_pts_attr_dh_nonce_params_resp
18 * @{ @ingroup tcg_pts_attr_dh_nonce_params_resp
19 */
20
21 #ifndef TCG_PTS_ATTR_DH_NONCE_PARAMS_RESP_H_
22 #define TCG_PTS_ATTR_DH_NONCE_PARAMS_RESP_H_
23
24 typedef struct tcg_pts_attr_dh_nonce_params_resp_t tcg_pts_attr_dh_nonce_params_resp_t;
25
26 #include "tcg_attr.h"
27 #include "pa_tnc/pa_tnc_attr.h"
28 #include "tcg_pts_attr_dh_nonce_params_req.h"
29 #include "pts/pts_meas_algo.h"
30
31 /**
32 * Class implementing the TCG PTS DH Nonce Parameters Response Attribute
33 */
34 struct tcg_pts_attr_dh_nonce_params_resp_t {
35
36 /**
37 * Public PA-TNC attribute interface
38 */
39 pa_tnc_attr_t pa_tnc_attribute;
40
41 /**
42 * Get nonce length
43 *
44 * @return Length of nonce
45 */
46 u_int8_t (*get_nonce_len)(tcg_pts_attr_dh_nonce_params_resp_t *this);
47
48 /**
49 * Get selected Diffie Hellman Group
50 *
51 * @return Selected Diffie Hellman Group
52 */
53 pts_dh_group_t (*get_dh_group)(tcg_pts_attr_dh_nonce_params_resp_t *this);
54
55 /**
56 * Get supported hash algorithms
57 *
58 * @return Hash algorithm set
59 */
60 pts_meas_algorithms_t (*get_hash_algo_set)(tcg_pts_attr_dh_nonce_params_resp_t *this);
61
62 /**
63 * Get DH Responder Nonce
64 *
65 * @return DH Responder Nonce
66 */
67 chunk_t (*get_responder_nonce)(tcg_pts_attr_dh_nonce_params_resp_t *this);
68
69 /**
70 * Get DH Responder Public Value
71 *
72 * @return DH Responder Public Value
73 */
74 chunk_t (*get_responder_pub_val)(tcg_pts_attr_dh_nonce_params_resp_t *this);
75
76 };
77
78 /**
79 * Creates an tcg_pts_attr_dh_nonce_params_resp_t object
80 *
81 * @param nonce_len Length of nonce
82 * @param dh_group Selected DH group
83 * @param hash_algo_set Set of supported hash algorithms
84 * @param responder_nonce DH Responder Nonce
85 * @param responder_pub_val DH Responder Public value
86 */
87 pa_tnc_attr_t* tcg_pts_attr_dh_nonce_params_resp_create(u_int8_t nonce_len,
88 pts_dh_group_t dh_group,
89 pts_meas_algorithms_t hash_algo_set,
90 chunk_t responder_nonce,
91 chunk_t responder_pub_val);
92
93 /**
94 * Creates an tcg_pts_attr_dh_nonce_params_resp_t object from received data
95 *
96 * @param value unparsed attribute value
97 */
98 pa_tnc_attr_t* tcg_pts_attr_dh_nonce_params_resp_create_from_data(chunk_t value);
99
100 #endif /** TCG_PTS_ATTR_DH_NONCE_PARAMS_RESP_H_ @}*/