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 { ... }
}
Available on crate feature builder only.
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.

Object Safety§

This trait is not object safe.

Implementors§