Implemented Diffie Hellman Nonce attributes
[strongswan.git] / src / libpts / tcg / tcg_pts_attr_dh_nonce_finish.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_finish tcg_pts_attr_dh_nonce_finish
18 * @{ @ingroup tcg_pts_attr_dh_nonce_finish
19 */
20
21 #ifndef TCG_PTS_ATTR_DH_NONCE_FINISH_H_
22 #define TCG_PTS_ATTR_DH_NONCE_FINISH_H_
23
24 typedef struct tcg_pts_attr_dh_nonce_finish_t tcg_pts_attr_dh_nonce_finish_t;
25
26 #include "tcg_attr.h"
27 #include "pa_tnc/pa_tnc_attr.h"
28 #include "pts/pts_meas_algo.h"
29
30 /**
31 * Class implementing the TCG PTS DH Nonce Finish Attribute
32 */
33 struct tcg_pts_attr_dh_nonce_finish_t {
34
35 /**
36 * Public PA-TNC attribute interface
37 */
38 pa_tnc_attr_t pa_tnc_attribute;
39
40 /**
41 * Get nonce length
42 *
43 * @return Length of nonce
44 */
45 u_int8_t (*get_nonce_len)(tcg_pts_attr_dh_nonce_finish_t *this);
46
47 /**
48 * Get selected hash algorithm
49 *
50 * @return Selected hash algorithm
51 */
52 pts_meas_algorithms_t (*get_hash_algo)(tcg_pts_attr_dh_nonce_finish_t *this);
53
54 /**
55 * Get DH Initiator Public Value
56 *
57 * @return DH Initiator Public Value
58 */
59 chunk_t (*get_initiator_pub_val)(tcg_pts_attr_dh_nonce_finish_t *this);
60
61 /**
62 * Get DH Initiator Nonce
63 *
64 * @return DH Initiator Nonce
65 */
66 chunk_t (*get_initiator_nonce)(tcg_pts_attr_dh_nonce_finish_t *this);
67
68 };
69
70 /**
71 * Creates an tcg_pts_attr_dh_nonce_finish_t object
72 *
73 * @param nonce_len Length of nonce
74 * @param hash_algo Selected hash algorithm
75 * @param initiator_nonce DH Initiator Nonce
76 * @param initiator_pub_val DH Initiator Public value
77 */
78 pa_tnc_attr_t* tcg_pts_attr_dh_nonce_finish_create(u_int8_t nonce_len,
79 pts_meas_algorithms_t hash_algo,
80 chunk_t initiator_nonce,
81 chunk_t initiator_pub_val);
82
83 /**
84 * Creates an tcg_pts_attr_dh_nonce_finish_t object from received data
85 *
86 * @param value unparsed attribute value
87 */
88 pa_tnc_attr_t* tcg_pts_attr_dh_nonce_finish_create_from_data(chunk_t value);
89
90 #endif /** TCG_PTS_ATTR_DH_NONCE_FINISH_H_ @}*/