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§
Sourcefn policy_pcr(
&mut self,
pcr_digest: &Tpm2bDigest,
pcrs: TpmlPcrSelection,
) -> Result<(), PolicyError>
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.
Sourcefn policy_or(&mut self, p_hash_list: &TpmlDigest) -> Result<(), PolicyError>
fn policy_or(&mut self, p_hash_list: &TpmlDigest) -> Result<(), PolicyError>
Sourcefn policy_secret(
&mut self,
auth_handle: u32,
auth_handle_name: &Tpm2bName,
password: Option<&[u8]>,
cp_hash: Option<Tpm2bDigest>,
) -> Result<(), PolicyError>
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.
Sourcefn get_digest(&mut self) -> Result<Tpm2bDigest, PolicyError>
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.