2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
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>.
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
24 typedef struct pts_t pts_t
;
26 #include "pts_proto_caps.h"
27 #include "pts_meas_algo.h"
28 #include "pts_file_meas.h"
33 * Class implementing the TCG Platform Trust System (PTS)
39 * Get PTS Protocol Capabilities
41 * @return protocol capabilities flags
43 pts_proto_caps_flag_t (*get_proto_caps
)(pts_t
*this);
46 * Set PTS Protocol Capabilities
48 * @param flags protocol capabilities flags
50 void (*set_proto_caps
)(pts_t
*this, pts_proto_caps_flag_t flags
);
53 * Get PTS Measurement Algorithm
55 * @return measurement algorithm
57 pts_meas_algorithms_t (*get_meas_algorithm
)(pts_t
*this);
60 * Set PTS Measurement Algorithm
62 * @param algorithm measurement algorithm
64 void (*set_meas_algorithm
)(pts_t
*this, pts_meas_algorithms_t algorithm
);
67 * Get Platform and OS Info
69 * @return platform and OS info
71 char* (*get_platform_info
)(pts_t
*this);
74 * Set Platform and OS Info
76 * @param info platform and OS info
78 void (*set_platform_info
)(pts_t
*this, char *info
);
81 * Get TPM 1.2 Version Info
83 * @param info chunk containing a TPM_CAP_VERSION_INFO struct
84 * @return TRUE if TPM Version Info available
86 bool (*get_tpm_version_info
)(pts_t
*this, chunk_t
*info
);
89 * Set TPM 1.2 Version Info
91 * @param info chunk containing a TPM_CAP_VERSION_INFO struct
93 void (*set_tpm_version_info
)(pts_t
*this, chunk_t info
);
96 * Get Attestation Identity Key
98 * @param aik chunk containing a AIK naked public key or certificate
99 * @param is_naked_key TRUE if AIK is naked public key, without certificate
100 * @return TRUE if AIK available
102 bool (*get_aik
)(pts_t
*this, chunk_t
*aik
, bool *is_naked_key
);
105 * Set Attestation Identity Key
107 * @param aik chunk containing a AIK naked public key or certificate
108 * @param is_naked_key TRUE if AIK is naked public key, without certificate
110 void (*set_aik
)(pts_t
*this, chunk_t aik
, bool is_naked_key
);
113 * Do PTS File Measurements
115 * @param request_id ID of PTS File Measurement Request
116 * @param pathname Absolute pathname of file to be measured
117 * @param is_directory if TRUE directory contents are measured
118 * @return PTS File Measurements of NULL if FAILED
120 pts_file_meas_t
* (*do_measurements
)(pts_t
*this, u_int16_t request_id
,
121 char *pathname
, bool is_directory
);
124 * Destroys a pts_t object.
126 void (*destroy
)(pts_t
*this);
131 * Creates an pts_t object
133 * @param is_imc TRUE if running on an IMC
135 pts_t
* pts_create(bool is_imc
);
137 #endif /** PTS_H_ @}*/