PolicySession

Trait PolicySession 

Source
pub trait PolicySession {
    // Required methods
    fn device(&mut self) -> &mut Device;
    fn policy_pcr(
        &mut self,
        pcr_digest: &Tpm2bDigest,
        pcrs: TpmlPcrSelection,
    ) -> Result<(), PolicyError>;
    fn policy_or(&mut self, p_hash_list: &TpmlDigest) -> Result<(), PolicyError>;
    fn policy_secret(
        &mut self,
        auth_handle: u32,
        auth_handle_name: &Tpm2bName,
        password: Option<&[u8]>,
        cp_hash: Option<Tpm2bDigest>,
    ) -> Result<(), PolicyError>;
    fn get_digest(&mut self) -> Result<Tpm2bDigest, PolicyError>;
    fn hash_alg(&self) -> TpmAlgId;
}
Expand description

An abstract interface for a session that can have a policy applied to it.

Required Methods§

Source

fn device(&mut self) -> &mut Device

Returns the device associated with the session.

Source

fn policy_pcr( &mut self, pcr_digest: &Tpm2bDigest, pcrs: TpmlPcrSelection, ) -> Result<(), PolicyError>

Applies a TPM2_PolicyPCR action to the session.

§Errors

Returns an error if the policy action fails.

Source

fn policy_or(&mut self, p_hash_list: &TpmlDigest) -> Result<(), PolicyError>

Applies a TPM2_PolicyOR action to the session.

§Errors

Returns an error if the policy action fails.

Source

fn policy_secret( &mut self, auth_handle: u32, auth_handle_name: &Tpm2bName, password: Option<&[u8]>, cp_hash: Option<Tpm2bDigest>, ) -> Result<(), PolicyError>

Applies a TPM2_PolicySecret action to the session.

§Errors

Returns an error if the policy action fails.

Source

fn get_digest(&mut self) -> Result<Tpm2bDigest, PolicyError>

Retrieves the final policy digest from the session.

§Errors

Returns an error if the digest cannot be retrieved.

Source

fn hash_alg(&self) -> TpmAlgId

Returns the session’s hash algorithm.

Implementors§