Skip to main content

Builder

Trait Builder 

Source
pub trait Builder: Sized {
    type Signer;
    type Output: Sized;

    // Required methods
    fn signer(&self) -> &Self::Signer;
    fn assemble(self, signature: BitString) -> Result<Self::Output, Error>;
    fn finalize(&mut self) -> Result<Vec<u8>>;

    // Provided methods
    fn build<Signature>(self) -> Result<Self::Output, Error>
       where Self::Signer: Signer<Signature>,
             Signature: SignatureBitStringEncoding { ... }
    fn build_with_rng<Signature>(
        self,
        rng: &mut impl CryptoRngCore,
    ) -> Result<Self::Output, Error>
       where Self::Signer: RandomizedSigner<Signature>,
             Signature: SignatureBitStringEncoding { ... }
}
Expand description

Trait for X509 builders

This trait defines the interface between builder and the signers.

Required Associated Types§

Source

type Signer

The builder’s object signer

Source

type Output: Sized

Type built by this builder

Required Methods§

Source

fn signer(&self) -> &Self::Signer

Return a reference to the signer.

Source

fn assemble(self, signature: BitString) -> Result<Self::Output, Error>

Assemble the final object from signature.

Source

fn finalize(&mut self) -> Result<Vec<u8>>

Finalize and return a serialization of the object for signature.

Provided Methods§

Source

fn build<Signature>(self) -> Result<Self::Output, Error>
where Self::Signer: Signer<Signature>, Signature: SignatureBitStringEncoding,

Run the object through the signer and build it.

Source

fn build_with_rng<Signature>( self, rng: &mut impl CryptoRngCore, ) -> Result<Self::Output, Error>
where Self::Signer: RandomizedSigner<Signature>, Signature: SignatureBitStringEncoding,

Run the object through the signer and build it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§