pub struct TpmsAuthCommandWire(/* private fields */);Implementations§
Source§impl TpmsAuthCommandWire
impl TpmsAuthCommandWire
Sourcepub fn cast(buf: &[u8]) -> TpmResult<&Self>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a>,
pub fn cast(buf: &[u8]) -> TpmResult<&Self>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a>,
Casts bytes into a typed wire structure view.
§Errors
Returns Err(TpmError) when buf is not exactly one valid wire
structure.
Sourcepub fn cast_prefix(buf: &[u8]) -> TpmResult<(&Self, &[u8])>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a>,
pub fn cast_prefix(buf: &[u8]) -> TpmResult<(&Self, &[u8])>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a>,
Casts the first typed wire structure from buf and returns the remainder.
§Errors
Returns Err(TpmError) when buf does not start with a valid wire
structure.
Sourcepub unsafe fn cast_unchecked(buf: &[u8]) -> &Self
pub unsafe fn cast_unchecked(buf: &[u8]) -> &Self
Casts bytes into a typed wire structure view without validation.
§Safety
The caller must ensure buf is exactly one valid wire structure.
Sourcepub fn validate(buf: &[u8]) -> TpmResult<()>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a>,
pub fn validate(buf: &[u8]) -> TpmResult<()>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a>,
Validates an exact typed wire structure view.
§Errors
Returns Err(TpmError) when buf is not exactly one valid wire
structure.
Sourcepub fn validate_prefix(buf: &[u8]) -> TpmResult<usize>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a>,
pub fn validate_prefix(buf: &[u8]) -> TpmResult<usize>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a>,
Validates a typed wire structure prefix.
§Errors
Returns Err(TpmError) when buf does not start with a valid wire
structure.
Sourcepub fn session_handle(&self) -> TpmResult<&TpmHandle>
pub fn session_handle(&self) -> TpmResult<&TpmHandle>
Returns a borrowed field view.
§Errors
Returns Err(TpmError) when preceding fields or this field are malformed.
Sourcepub fn nonce(&self) -> TpmResult<&Tpm2bNonce>
pub fn nonce(&self) -> TpmResult<&Tpm2bNonce>
Returns a borrowed field view.
§Errors
Returns Err(TpmError) when preceding fields or this field are malformed.
Sourcepub fn session_attributes(&self) -> TpmResult<&TpmaSession>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a, View = &'a TpmaSession>,
pub fn session_attributes(&self) -> TpmResult<&TpmaSession>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a, View = &'a TpmaSession>,
Returns a borrowed field view.
§Errors
Returns Err(TpmError) when preceding fields or this field are malformed.
Sourcepub fn hmac(&self) -> TpmResult<&Tpm2bAuth>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a, View = &'a Tpm2bAuth>,
pub fn hmac(&self) -> TpmResult<&Tpm2bAuth>where
TpmHandle: for<'a> TpmField<'a>,
Tpm2bNonce: for<'a> TpmField<'a>,
TpmaSession: for<'a> TpmField<'a>,
Tpm2bAuth: for<'a> TpmField<'a, View = &'a Tpm2bAuth>,
Returns a borrowed field view.
§Errors
Returns Err(TpmError) when preceding fields or this field are malformed.