2 * Copyright (C) 2011 Andreas Steffen
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
18 * @defgroup attest_db_t attest_db
19 * @{ @ingroup attest_db
25 #include <pts/pts_meas_algo.h>
29 typedef struct attest_db_t attest_db_t
;
32 * Attestation database object
37 * Set functional component to be queried
39 * @param comp functional component
40 * @param create if TRUE create database entry if it doesn't exist
41 * @return TRUE if successful
43 bool (*set_component
)(attest_db_t
*this, char *comp
, bool create
);
46 * Set primary key of the functional component to be queried
48 * @param fid primary key of functional component
49 * @return TRUE if successful
51 bool (*set_cid
)(attest_db_t
*this, int fid
);
54 * Set directory to be queried
56 * @param dir directory
57 * @param create if TRUE create database entry if it doesn't exist
58 * @return TRUE if successful
60 bool (*set_directory
)(attest_db_t
*this, char *dir
, bool create
);
63 * Set primary key of the directory to be queried
65 * @param did primary key of directory
66 * @return TRUE if successful
68 bool (*set_did
)(attest_db_t
*this, int did
);
71 * Set measurement file to be queried
73 * @param file measurement file
74 * @param create if TRUE create database entry if it doesn't exist
75 * @return TRUE if successful
77 bool (*set_file
)(attest_db_t
*this, char *file
, bool create
);
80 * Set primary key of the measurement file to be queried
82 * @param fid primary key of measurement file
83 * @return TRUE if successful
85 bool (*set_fid
)(attest_db_t
*this, int fid
);
88 * Set functional component to be queried
91 * @param create if TRUE create database entry if it doesn't exist
92 * @return TRUE if successful
94 bool (*set_key
)(attest_db_t
*this, chunk_t key
, bool create
);
97 * Set primary key of the AIK to be queried
99 * @param kid primary key of AIK
100 * @return TRUE if successful
102 bool (*set_kid
)(attest_db_t
*this, int kid
);
105 * Set software product to be queried
107 * @param product software product
108 * @param create if TRUE create database entry if it doesn't exist
109 * @return TRUE if successful
111 bool (*set_product
)(attest_db_t
*this, char *product
, bool create
);
114 * Set primary key of the software product to be queried
116 * @param pid primary key of software product
117 * @return TRUE if successful
119 bool (*set_pid
)(attest_db_t
*this, int pid
);
122 * Set measurement hash algorithm
124 * @param algo hash algorithm
126 void (*set_algo
)(attest_db_t
*this, pts_meas_algorithms_t algo
);
129 * Set that the IMA-specific SHA-1 template hash be computed
131 void (*set_ima
)(attest_db_t
*this);
134 * Set that relative filenames are to be used
136 void (*set_relative
)(attest_db_t
*this);
139 * Set owner [user/host] of an AIK
141 * @param owner user/host name
142 * @return TRUE if successful
144 void (*set_owner
)(attest_db_t
*this, char *owner
);
147 * List all products stored in the database
149 void (*list_products
)(attest_db_t
*this);
152 * List selected files stored in the database
154 void (*list_files
)(attest_db_t
*this);
157 * List all components stored in the database
159 void (*list_components
)(attest_db_t
*this);
162 * List all AIKs stored in the database
164 void (*list_keys
)(attest_db_t
*this);
167 * List selected measurement hashes stored in the database
169 void (*list_hashes
)(attest_db_t
*this);
172 * List selected component measurement stored in the database
174 void (*list_measurements
)(attest_db_t
*this);
177 * Add an entry to the database
179 bool (*add
)(attest_db_t
*this);
182 * Delete an entry from the database
184 bool (*delete)(attest_db_t
*this);
187 * Destroy attest_db_t object
189 void (*destroy
)(attest_db_t
*this);
194 * Create an attest_db_t instance
196 * @param uri database URI
198 attest_db_t
* attest_db_create(char *uri
);
200 #endif /** ATTEST_DB_H_ @}*/