2 * Copyright (C) 2016 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
17 * @defgroup tpm_tss tpm_tss
18 * @{ @ingroup libtpmtss
26 typedef enum tpm_version_t tpm_version_t
;
27 typedef struct tpm_tss_t tpm_tss_t
;
39 * TPM access via TSS public interface
44 * Get TPM version supported by TSS
48 tpm_version_t (*get_version
)(tpm_tss_t
*this);
51 * Get TPM version info (TPM 1.2 only)
53 * @return TPM version info struct
55 chunk_t (*get_version_info
)(tpm_tss_t
*this);
58 * Generate AIK key pair bound to TPM (TPM 1.2 only)
60 * @param ca_modulus RSA modulus of CA public key
61 * @param aik_blob AIK private key blob
62 * @param aik_pubkey AIK public key
63 * @return TRUE if AIK key generation succeeded
65 bool (*generate_aik
)(tpm_tss_t
*this, chunk_t ca_modulus
,
66 chunk_t
*aik_blob
, chunk_t
*aik_pubkey
,
67 chunk_t
*identity_req
);
70 * Get public key from TPM using its object handle (TPM 2.0 only)
72 * @param handle key object handle
73 * @return public key in PKCS#1 format
75 chunk_t (*get_public
)(tpm_tss_t
*this, uint32_t handle
);
78 * Destroy a tpm_tss_t.
80 void (*destroy
)(tpm_tss_t
*this);
84 * Create a tpm_tss instance.
86 * @param version TPM version that must be supported by TSS
88 tpm_tss_t
*tpm_tss_probe(tpm_version_t version
);
90 #endif /** TPM_TSS_H_ @}*/