Debugged TCG PTS attributes implementations
[strongswan.git] / src / libimcv / tcg / tcg_pts_attr_aik.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_aik tcg_pts_attr_aik
18 * @{ @ingroup tcg_pts_attr_aik
19 */
20
21 #ifndef TCG_PTS_ATTR_AIK_H_
22 #define TCG_PTS_ATTR_AIK_H_
23
24 typedef struct tcg_pts_attr_aik_t tcg_pts_attr_aik_t;
25
26 #include "tcg_attr.h"
27 #include "pa_tnc/pa_tnc_attr.h"
28
29 /**
30 * Class implementing the TCG PTS Attestation Identity Key attribute
31 *
32 */
33 struct tcg_pts_attr_aik_t {
34
35 /**
36 * Public PA-TNC attribute interface
37 */
38 pa_tnc_attr_t pa_tnc_attribute;
39
40 /**
41 * Get Naked Public Key flag
42 *
43 * @return Naked Public Key flag
44 */
45 bool (*get_naked_flag)(tcg_pts_attr_aik_t *this);
46
47 /**
48 * Set Naked Public Key flag
49 *
50 * @param naked flag
51 */
52 void (*set_naked_flag)(tcg_pts_attr_aik_t *this,
53 bool naked_pub_aik);
54
55 /**
56 * Get AIK
57 *
58 * @return Attestation Identity Key
59 */
60 chunk_t (*get_aik)(tcg_pts_attr_aik_t *this);
61
62 /**
63 * Set AIK
64 *
65 * @param flags set of flags
66 */
67 void (*set_aik)(tcg_pts_attr_aik_t *this,
68 chunk_t aik);
69 };
70
71 /**
72 * Creates an tcg_pts_attr_aik_t object
73 *
74 * @param naked_pub_aik Sender only has naked public key
75 * @param aik Attestation Identity Key
76 */
77 pa_tnc_attr_t* tcg_pts_attr_aik_create(bool naked_pub_aik, chunk_t aik);
78
79 /**
80 * Creates an tcg_pts_attr_aik_t object from received data
81 *
82 * @param value unparsed attribute value
83 */
84 pa_tnc_attr_t* tcg_pts_attr_aik_create_from_data(chunk_t value);
85
86 #endif /** TCG_PTS_ATTR_AIK_H_ @}*/