Struct tss_esapi::structures::PublicRsaParametersBuilder
source · pub struct PublicRsaParametersBuilder { /* private fields */ }
Expand description
Builder for TPMS_RSA_PARMS
values.
Implementations§
source§impl PublicRsaParametersBuilder
impl PublicRsaParametersBuilder
sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new PublicRsaParametersBuilder
sourcepub const fn new_restricted_decryption_key(
symmetric: SymmetricDefinitionObject,
key_bits: RsaKeyBits,
exponent: RsaExponent
) -> Self
pub const fn new_restricted_decryption_key( symmetric: SymmetricDefinitionObject, key_bits: RsaKeyBits, exponent: RsaExponent ) -> Self
Creates a PublicRsaParametersBuilder that is setup to build a restructed decryption key.
sourcepub const fn new_unrestricted_signing_key(
rsa_scheme: RsaScheme,
key_bits: RsaKeyBits,
exponent: RsaExponent
) -> Self
pub const fn new_unrestricted_signing_key( rsa_scheme: RsaScheme, key_bits: RsaKeyBits, exponent: RsaExponent ) -> Self
Creates a PublicRsaParametersBuilder that is setup to build an unrestricted signing key.
sourcepub const fn with_symmetric(self, symmetric: SymmetricDefinitionObject) -> Self
pub const fn with_symmetric(self, symmetric: SymmetricDefinitionObject) -> Self
Adds a SymmetricDefinitionObject to the PublicRsaParametersBuilder.
sourcepub const fn with_scheme(self, rsa_scheme: RsaScheme) -> Self
pub const fn with_scheme(self, rsa_scheme: RsaScheme) -> Self
Adds a RsaScheme to the PublicRsaParametersBuilder.
sourcepub const fn with_key_bits(self, key_bits: RsaKeyBits) -> Self
pub const fn with_key_bits(self, key_bits: RsaKeyBits) -> Self
Adds RsaKeyBits to the PublicRsaParametersBuilder.
sourcepub const fn with_exponent(self, exponent: RsaExponent) -> Self
pub const fn with_exponent(self, exponent: RsaExponent) -> Self
Adds RsaExponent to the PublicRsaParametersBuilder.
sourcepub const fn with_is_signing_key(self, set: bool) -> Self
pub const fn with_is_signing_key(self, set: bool) -> Self
Adds a flag that indicates if the key is going to be used for signing to the PublicRsaParametersBuilder.
§Arguments
set
-true
inidcates that the key is going to be used for signing operations.false
indicates that the key is not going to be used for signing operations.
sourcepub const fn with_is_decryption_key(self, set: bool) -> Self
pub const fn with_is_decryption_key(self, set: bool) -> Self
Adds a flag that indicates if the key is going to be used for decryption to the PublicRsaParametersBuilder.
§Arguments
set
-true
indicates that the key is going to be used for decryption operations.false
indicates that the key is not going to be used for decryption operations.
sourcepub const fn with_restricted(self, set: bool) -> Self
pub const fn with_restricted(self, set: bool) -> Self
Adds a flag that inidcates if the key is going to be restrictied to the PublicRsaParametersBuilder.
§Arguments
set
-true
indicates that it is going to be a restricted key.false
indicates that it is going to be a non restricted key.
sourcepub fn build(self) -> Result<PublicRsaParameters>
pub fn build(self) -> Result<PublicRsaParameters>
Build an object given the previously provided 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
andrestricted
parameters are inconsistent with the rest of the parameters,InconsistentParams
wrapper error is returned
Trait Implementations§
source§impl Clone for PublicRsaParametersBuilder
impl Clone for PublicRsaParametersBuilder
source§fn clone(&self) -> PublicRsaParametersBuilder
fn clone(&self) -> PublicRsaParametersBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more