Struct tss_esapi::structures::PcrSelection
source · [−]pub struct PcrSelection { /* private fields */ }Expand description
This module contains the PcrSelection struct. The TSS counterpart of this struct is the TPMS_PCR_SELECTION.
Implementations
sourceimpl PcrSelection
impl PcrSelection
sourcepub fn create(
hashing_algorithm: HashingAlgorithm,
size_of_select: PcrSelectSize,
selected_pcr_slots: &[PcrSlot]
) -> Result<Self>
pub fn create(
hashing_algorithm: HashingAlgorithm,
size_of_select: PcrSelectSize,
selected_pcr_slots: &[PcrSlot]
) -> Result<Self>
Creates new PcrSelection
Errors
Returns InconsistentParams error if a pcr slot
has been provided that ends up in an octet outside the
range specified by the size_of_select parameter.
sourcepub const fn hashing_algorithm(&self) -> HashingAlgorithm
pub const fn hashing_algorithm(&self) -> HashingAlgorithm
Returns the hashing algorithm for the selection
sourcepub const fn size_of_select(&self) -> PcrSelectSize
pub const fn size_of_select(&self) -> PcrSelectSize
Returns ‘Size of Select’
NB! This is not the same as how many PcrSlot there are in the selection but rather how many octets that are needed to hold the bit field that indicate what slots that are selected.
sourcepub fn selected(&self) -> Vec<PcrSlot>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn selected(&self) -> Vec<PcrSlot>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the selected pcrs.
sourcepub fn is_selected(&self, pcr_slot: PcrSlot) -> bool
pub fn is_selected(&self, pcr_slot: PcrSlot) -> bool
Returns true if the specified PcrSlot is selected in the PcrSelection.
sourcepub fn deselect_exact(&mut self, pcr_slot: PcrSlot) -> Result<()>
pub fn deselect_exact(&mut self, pcr_slot: PcrSlot) -> Result<()>
sourcepub fn deselect(&mut self, pcr_slot: PcrSlot)
pub fn deselect(&mut self, pcr_slot: PcrSlot)
Removes the specified PcrSlots from the selected pcrs.
sourcepub fn merge_exact(&mut self, other: &Self) -> Result<()>
pub fn merge_exact(&mut self, other: &Self) -> Result<()>
Merges another PcrSelection into self if the
elements in the collection does not already exist
in self.
Constraints
- Cannot be called with
otherthat has a hashing_algorithm that is different from the one inself. - Cannot be called with
otherthat has a size_of_select that is different from the one inself. - Cannot be called with
otherthat contains pcr slots present inself.
Errors
Returns InvalidParam if there is a hashing algorithm mismatch
Returns InvalidParam if there is size of select mismatch.
Returns InvalidParam if other contains items that are present in self
sourcepub fn subtract_exact(&mut self, other: &Self) -> Result<()>
pub fn subtract_exact(&mut self, other: &Self) -> Result<()>
Removes the selected pcr slots in other from selfif none
of the pcr slots are present in self.
Constraints
- Cannot be called with
otherthat has a hashing_algorithm that is different from the one inself. - Cannot be called with
otherthat has a size_of_select that is different from the one inself. - Cannot be called with
otherthat contains pcr slots not present inself.
Trait Implementations
sourceimpl Clone for PcrSelection
impl Clone for PcrSelection
sourcefn clone(&self) -> PcrSelection
fn clone(&self) -> PcrSelection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for PcrSelection
impl Debug for PcrSelection
sourceimpl From<PcrSelection> for TPMS_PCR_SELECTION
impl From<PcrSelection> for TPMS_PCR_SELECTION
sourcefn from(pcr_selection: PcrSelection) -> Self
fn from(pcr_selection: PcrSelection) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<PcrSelection> for PcrSelection
impl PartialEq<PcrSelection> for PcrSelection
sourcefn eq(&self, other: &PcrSelection) -> bool
fn eq(&self, other: &PcrSelection) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &PcrSelection) -> bool
fn ne(&self, other: &PcrSelection) -> bool
This method tests for !=.
sourceimpl TryFrom<TPMS_PCR_SELECTION> for PcrSelection
impl TryFrom<TPMS_PCR_SELECTION> for PcrSelection
impl Copy for PcrSelection
impl Eq for PcrSelection
impl StructuralEq for PcrSelection
impl StructuralPartialEq for PcrSelection
Auto Trait Implementations
impl RefUnwindSafe for PcrSelection
impl Send for PcrSelection
impl Sync for PcrSelection
impl Unpin for PcrSelection
impl UnwindSafe for PcrSelection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more