pub struct PcrSelectionListBuilder { /* private fields */ }
Expand description
A builder for the PcrSelectionList struct.
Implementations§
source§impl PcrSelectionListBuilder
impl PcrSelectionListBuilder
pub fn new() -> Self
sourcepub fn with_size_of_select(self, size_of_select: PcrSelectSize) -> Self
pub fn with_size_of_select(self, size_of_select: PcrSelectSize) -> Self
Set the size of the pcr selection(sizeofSelect)
§Arguments
size_of_select – The size that will be used for all selections(sizeofSelect).
sourcepub fn with_selection(
self,
hash_algorithm: HashingAlgorithm,
pcr_slots: &[PcrSlot]
) -> Self
pub fn with_selection( self, hash_algorithm: HashingAlgorithm, pcr_slots: &[PcrSlot] ) -> Self
Adds a selection associated with a specific HashingAlgorithm.
This function will not overwrite the values already associated with a specific HashingAlgorithm only update.
§Arguments
hash_algorithm – The HashingAlgorithm associated with the pcr selection pcr_slots – The PCR slots in the selection.
sourcepub fn build(self) -> Result<PcrSelectionList>
pub fn build(self) -> Result<PcrSelectionList>
Builds a PcrSelections with the values that have been provided.
If no size of select have been provided then it will be defaulted to to the most suitable with regard to TPM2_PCR_SELECT_MAX. This may not be the correct size for the current platform. The correct values can be obtained by querying the tpm for its capabilities.