pub struct AttestationMgr { /* private fields */ }Expand description
Attestation manager implementing get_delegated_key and get_platform_token functinality.
Implementations§
Source§impl AttestationMgr
impl AttestationMgr
pub fn calculate_cpak_hash(&self) -> Vec<u8>
pub fn calculate_dak_hash(&self, hash_algo: HashAlgo) -> Vec<u8>
Sourcepub fn init(key_derivation_material: KeyMaterialData, claims: HWClaims) -> Self
pub fn init(key_derivation_material: KeyMaterialData, claims: HWClaims) -> Self
Initialize AttestationMgr using KeyMaterialData and HWClaims.
Generates a CPAK using key_material_data.
Sourcepub fn get_delegated_key(
&mut self,
_ecc_family: ECCFamily,
key_bits: KeyBits,
hash_algo: HashAlgo,
measurements: &[Measurement],
) -> Result<Vec<u8>, AttestationError>
pub fn get_delegated_key( &mut self, _ecc_family: ECCFamily, key_bits: KeyBits, hash_algo: HashAlgo, measurements: &[Measurement], ) -> Result<Vec<u8>, AttestationError>
Generates DAK with ECCFamily and uses measurements (Measurement)
as salt in the process.
Returns bytes of a scalar primitive, which can be used to recreate DAK Private Key.
HashAlgo is used for verification process, when get_platform_token is called.
Returns AttestationError::GenericError, when CBOR or crypto operation fails.
Sourcepub fn get_platform_token(
&mut self,
dak_pub_hash: &[u8],
measurements: &[Measurement],
) -> Result<CoseSign1, AttestationError>
pub fn get_platform_token( &mut self, dak_pub_hash: &[u8], measurements: &[Measurement], ) -> Result<CoseSign1, AttestationError>
Creates a tagged [CoseSign1] of the platform token.
dak_pub_hash must be a valid hash of DAK Public Key using HashAlgo passed
in AttestationMgr::get_delegated_key.
Returns AttestationError::GenericError, when CBOR or crypto operation fails.
Returns AttestationError::InvalidArgument, when DAK was not requsted before
this operation, or dak_pub_hash is not a valid hash of DAK Public Key.