Struct tss_esapi::structures::PublicBuilder

source ·
pub struct PublicBuilder { /* private fields */ }
Expand description

A builder for the Public type.

Implementations§

source§

impl PublicBuilder

source

pub const fn new() -> Self

Creates a new PublicBuilder

§Details

Builds the Public type using the provided parameters. Parameters associated with other algorithms then the provided public algorithm will be ignored.

source

pub const fn with_public_algorithm( self, public_algorithm: PublicAlgorithm ) -> Self

Adds the public algorithm for the Public structure to the builder.

source

pub const fn with_object_attributes( self, object_attributes: ObjectAttributes ) -> Self

Adds the attributes of the Public structure to the builder

source

pub const fn with_name_hashing_algorithm( self, name_hashing_algorithm: HashingAlgorithm ) -> Self

Adds the name hash algorithm for the Public structure to the builder.

source

pub fn with_auth_policy(self, auth_policy: Digest) -> Self

Adds the auth policy for the Public structure to the builder

source

pub fn with_rsa_parameters(self, rsa_parameters: PublicRsaParameters) -> Self

Adds the RSA parameters for the Public structure to the builder.

§Details

This is required if the public algorithm is set to Rsa.

source

pub fn with_rsa_unique_identifier( self, rsa_unique_identifier: PublicKeyRsa ) -> Self

Adds the RSA unique identifier for the Public structure to the builder.

§Details

This is required if the public algorithm is set to Rsa.

The unique identifier is the public key.

source

pub fn with_keyed_hash_parameters( self, keyed_hash_parameters: PublicKeyedHashParameters ) -> Self

Adds the keyed hash parameters for the Public structure to the builder.

§Details

This is required if the public algorithm is set to KeyedHash.

source

pub fn with_keyed_hash_unique_identifier( self, keyed_hash_unique_identifier: Digest ) -> Self

Adds the keyed hash unique identifier for the Public structure to the builder.

§Details

This is required if the public algorithm is set to KeyedHash.

source

pub const fn with_ecc_parameters( self, ecc_parameters: PublicEccParameters ) -> Self

Adds the ECC parameters for the Public structure to the builder.

§Details

This is required if the public algorithm is set to Ecc.

source

pub fn with_ecc_unique_identifier(self, ecc_unique_identifier: EccPoint) -> Self

Adds the ECC unique identifier for the Public structure to the builder.

§Details

This is required if the public algorithm is set to Ecc.

The unique identifier is a ecc point.

source

pub const fn with_symmetric_cipher_parameters( self, symmetric_cipher_parameters: SymmetricCipherParameters ) -> Self

Adds the symmetric cipher parameters for the Public structure to the builder.

§Details

This is required if the public algorithm is set to SymCipher.

source

pub fn with_symmetric_cipher_unique_identifier( self, symmetric_cipher_unique_identifier: Digest ) -> Self

Adds the symmetric cipher unique identifier for the Public structure to the builder.

§Details

This is required if the public algorithm is set to SymCipher.

source

pub fn build(self) -> Result<Public>

Builds the Public structure.

§Errors

Will return error if the public algorithm, object attributes or name hashing algorithm have not been set or if the parameters and unique identifier does not match the selected public algorithm.

Trait Implementations§

source§

impl Clone for PublicBuilder

source§

fn clone(&self) -> PublicBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Free for T

source§

unsafe fn free(ptr_ref: NonNull<T>)

Drops the content pointed by this pointer and frees it. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.