[][src]Struct tss_esapi::utils::TpmtSymDefBuilder

pub struct TpmtSymDefBuilder { /* fields omitted */ }

Builder for TPMT_SYM_DEF objects.

Implementations

impl TpmtSymDefBuilder[src]

pub fn new() -> Self[src]

Create a new builder with default (i.e. empty or null) placeholder values.

pub fn with_algorithm(self, algorithm: TPM2_ALG_ID) -> Self[src]

Set the symmetric algorithm.

pub fn with_key_bits(self, key_bits: TPM2_KEY_BITS) -> Self[src]

Set the key length.

pub fn with_hash(self, hash: TPM2_ALG_ID) -> Self[src]

Set the hash algorithm (applies when the symmetric algorithm is XOR).

pub fn with_mode(self, mode: TPM2_ALG_ID) -> Self[src]

Set the mode of the symmetric algorithm.

pub fn build(self) -> Result<TPMT_SYM_DEF>[src]

Build a TPMT_SYM_DEF given the previously provided parameters.

Errors

  • if an unrecognized symmetric algorithm type was set, UnsupportedParam wrapper error is returned.
  • if an algorithm is not explicitly set, ParamsMissing is returned

pub fn build_object(self) -> Result<TPMT_SYM_DEF_OBJECT>[src]

Build a TPMT_SYM_DEF_OBJECT given the previously provided parameters.

Errors

  • if an unrecognized symmetric algorithm type was set, UnsupportedParam wrapper error is returned.
  • if an algorithm is not explicitly set, ParamsMissing is returned

Trait Implementations

impl Clone for TpmtSymDefBuilder[src]

impl Copy for TpmtSymDefBuilder[src]

impl Debug for TpmtSymDefBuilder[src]

impl Default for TpmtSymDefBuilder[src]

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.