#[repr(C)]pub struct Tcg { /* private fields */ }
Expand description
Protocol for interacting with TPM 1.1 and 1.2 devices.
The corresponding C type is EFI_TCG_PROTOCOL
.
Implementations§
source§impl Tcg
impl Tcg
sourcepub fn status_check(&mut self) -> Result<StatusCheck<'_>>
pub fn status_check(&mut self) -> Result<StatusCheck<'_>>
Get information about the protocol and TPM device, as well as the TPM event log.
sourcepub fn log_event(&mut self, event: &PcrEvent) -> Result
pub fn log_event(&mut self, event: &PcrEvent) -> Result
Add an entry to the event log without extending a PCR.
Usually hash_log_extend_event
should be used instead. An
entry added via log_event
cannot be verified, so it is mainly
intended for adding an informational entry.
sourcepub fn hash_log_extend_event(
&mut self,
event: &mut PcrEvent,
data_to_hash: Option<&[u8]>
) -> Result
pub fn hash_log_extend_event( &mut self, event: &mut PcrEvent, data_to_hash: Option<&[u8]> ) -> Result
Extend a PCR and add an entry to the event log.
If data_to_hash
is None
then the digest
field of the event
should be used as-is. Otherwise, the digest
field will be overwritten
with the SHA-1 hash of the data.
sourcepub fn pass_through_to_tpm(
&mut self,
input_parameter_block: &[u8],
output_parameter_block: &mut [u8]
) -> Result
pub fn pass_through_to_tpm( &mut self, input_parameter_block: &[u8], output_parameter_block: &mut [u8] ) -> Result
Send a command directly to the TPM.
Constructing the input block and parsing the output block are outside the scope of this crate. See the TPM 1.2 Main Specification documents for details of these blocks, in particular Part 3, Commands.
Note that TPM structures are big endian.