[][src]Struct tss_esapi::utils::TpmsRsaParmsBuilder

pub struct TpmsRsaParmsBuilder {
    pub symmetric: Option<TPMT_SYM_DEF_OBJECT>,
    pub scheme: Option<AsymSchemeUnion>,
    pub key_bits: TPMI_RSA_KEY_BITS,
    pub exponent: u32,
    pub for_signing: bool,
    pub for_decryption: bool,
    pub restricted: bool,
}

Builder for TPMS_RSA_PARMS values.

Fields

symmetric: Option<TPMT_SYM_DEF_OBJECT>

Symmetric cipher to be used in conjuction with the key

scheme: Option<AsymSchemeUnion>

Asymmetric scheme to be used for key operations

key_bits: TPMI_RSA_KEY_BITS

Size of key, in bits

exponent: u32

Public exponent of the key. A value of 0 defaults to 2 ^ 16 + 1

for_signing: bool

Flag indicating whether the key shall be used for signing

for_decryption: bool

Flag indicating whether the key shall be used for decryption

restricted: bool

Flag indicating whether the key is restricted

Implementations

impl TpmsRsaParmsBuilder[src]

pub fn new_restricted_decryption_key(
    symmetric: TPMT_SYM_DEF_OBJECT,
    key_bits: TPMI_RSA_KEY_BITS,
    exponent: u32
) -> Self
[src]

Create parameters for a restricted decryption key

pub fn new_unrestricted_signing_key(
    scheme: AsymSchemeUnion,
    key_bits: TPMI_RSA_KEY_BITS,
    exponent: u32
) -> Self
[src]

Create parameters for an unrestricted signing key

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

Build an object given the previously provded parameters.

The only mandatory parameter is the asymmetric scheme.

Errors

  • if no asymmetric scheme is set, ParamsMissing wrapper error is returned.
  • if the for_signing, for_decryption and restricted parameters are inconsistent with the rest of the parameters, InconsistentParams wrapper error is returned

Trait Implementations

impl Clone for TpmsRsaParmsBuilder[src]

impl Copy for TpmsRsaParmsBuilder[src]

impl Default for TpmsRsaParmsBuilder[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.