pub struct TpmPolicySession { /* private fields */ }Expand description
Represents an active TPM policy session.
Implementations§
Source§impl TpmPolicySession
impl TpmPolicySession
Sourcepub fn builder() -> TpmPolicySessionBuilder
pub fn builder() -> TpmPolicySessionBuilder
Creates a new builder for TpmPolicySession.
Sourcepub fn attributes(&self) -> TpmaSession
pub fn attributes(&self) -> TpmaSession
Returns the session attributes.
Sourcepub fn nonce_tpm(&self) -> &Tpm2bNonce
pub fn nonce_tpm(&self) -> &Tpm2bNonce
Returns the nonce generated by the TPM.
Sourcepub fn run(
&self,
device: &mut TpmDevice,
commands: Vec<(TpmCommand, TpmAuthCommands)>,
) -> Result<(), TpmDeviceError>
pub fn run( &self, device: &mut TpmDevice, commands: Vec<(TpmCommand, TpmAuthCommands)>, ) -> Result<(), TpmDeviceError>
Applies a list of policy commands to this session.
This method iterates through the provided commands, updates the first handle
of each command (or second for PolicySecret) to point to this session,
and transmits them to the device.
§Errors
Returns InvalidCc when a command is not
a supported policy command.
Returns other TpmDeviceError variants when
TpmDevice::transmit fails.
Sourcepub fn flush(&self, device: &mut TpmDevice) -> Result<(), TpmDeviceError>
pub fn flush(&self, device: &mut TpmDevice) -> Result<(), TpmDeviceError>
Flushes the session context from the TPM.
§Errors
Returns other TpmDeviceError variants when
TpmDevice::transmit fails.
Trait Implementations§
Source§impl Clone for TpmPolicySession
impl Clone for TpmPolicySession
Source§fn clone(&self) -> TpmPolicySession
fn clone(&self) -> TpmPolicySession
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TpmPolicySession
impl RefUnwindSafe for TpmPolicySession
impl Send for TpmPolicySession
impl Sync for TpmPolicySession
impl Unpin for TpmPolicySession
impl UnwindSafe for TpmPolicySession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more