Struct tss_esapi::structures::pcr_selection_list::PcrSelectionList[][src]

pub struct PcrSelectionList { /* fields omitted */ }

A struct representing a pcr selection list. This corresponds to the TSS TPML_PCR_SELECTION.

Implementations

impl PcrSelectionList[src]

pub const MAX_SIZE: usize[src]

pub fn len(&self) -> usize[src]

Function for retrieiving the number of banks in the selection

pub fn is_empty(&self) -> bool[src]

Returns true if the selection is empty.

pub fn list_from_option(pcr_list: Option<PcrSelectionList>) -> PcrSelectionList[src]

Function for retrieving the PcrSelectionList from Option

This returns an empty list if None is passed

pub fn subtract(&mut self, other: &Self) -> Result<()>[src]

Removes items in other from `self.

Arguments

  • other - A PcrSelectionList containing items that will be removed from self.

Constraints

  • Cannot be called with other that contains items that are not present in self.

  • Cannot be called with other that contains pcr selection associated with a hashing algorithm that cannot be subtracted from the pcr selection associated with the same hashing algorithm in self.

Errors

  • Calling the method with other that contains items not present in self will result in an InvalidParam error.

Examples

use tss_esapi::structures::{PcrSelectionListBuilder, PcrSlot};
use tss_esapi::interface_types::algorithm::HashingAlgorithm;
// pcr selections
let mut pcr_selection_list = PcrSelectionListBuilder::new()
    .with_size_of_select(Default::default())
    .with_selection(HashingAlgorithm::Sha256, &[PcrSlot::Slot0, PcrSlot::Slot8])
    .build();

// Another pcr selections
let other = PcrSelectionListBuilder::new()
    .with_size_of_select(Default::default())
    .with_selection(
        HashingAlgorithm::Sha256, &[PcrSlot::Slot0],
    )
    .build();
pcr_selection_list.subtract(&other).unwrap();
assert_eq!(pcr_selection_list.len(), 1);

Trait Implementations

impl Clone for PcrSelectionList[src]

impl Debug for PcrSelectionList[src]

impl Eq for PcrSelectionList[src]

impl PartialEq<PcrSelectionList> for PcrSelectionList[src]

impl StructuralEq for PcrSelectionList[src]

impl StructuralPartialEq for PcrSelectionList[src]

impl TryFrom<TPML_PCR_SELECTION> for PcrSelectionList[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Free for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.