pub trait AsyncBuilder: Sized {
type Output: Sized;
// Required methods
fn assemble<S>(
self,
signature: BitString,
signer: &S,
) -> Result<Self::Output>
where S: Keypair + DynSignatureAlgorithmIdentifier,
S::VerifyingKey: EncodePublicKey;
fn finalize<S>(&mut self, signer: &S) -> Result<Vec<u8>>
where S: Keypair + DynSignatureAlgorithmIdentifier,
S::VerifyingKey: EncodePublicKey;
// Provided methods
async fn build_async<S, Signature>(self, signer: &S) -> Result<Self::Output>
where S: AsyncSigner<Signature> + Keypair + DynSignatureAlgorithmIdentifier,
S::VerifyingKey: EncodePublicKey,
Signature: SignatureBitStringEncoding { ... }
async fn build_with_rng_async<S, Signature, R>(
self,
signer: &S,
rng: &mut R,
) -> Result<Self::Output>
where S: AsyncRandomizedSigner<Signature> + Keypair + DynSignatureAlgorithmIdentifier,
S::VerifyingKey: EncodePublicKey,
Signature: SignatureBitStringEncoding,
R: CryptoRng + ?Sized { ... }
}Expand description
Trait for async X509 builders
This trait defines the interface between builder and the signers.
This is the async counterpart of Builder.
Required Associated Types§
Required Methods§
Sourcefn assemble<S>(self, signature: BitString, signer: &S) -> Result<Self::Output>
fn assemble<S>(self, signature: BitString, signer: &S) -> Result<Self::Output>
Assemble the final object from signature.
Provided Methods§
Sourceasync fn build_async<S, Signature>(self, signer: &S) -> Result<Self::Output>where
S: AsyncSigner<Signature> + Keypair + DynSignatureAlgorithmIdentifier,
S::VerifyingKey: EncodePublicKey,
Signature: SignatureBitStringEncoding,
async fn build_async<S, Signature>(self, signer: &S) -> Result<Self::Output>where
S: AsyncSigner<Signature> + Keypair + DynSignatureAlgorithmIdentifier,
S::VerifyingKey: EncodePublicKey,
Signature: SignatureBitStringEncoding,
Run the object through the signer and build it.
§Notes
When using ECDSA signers, the Signature parameter will need to be explicit
as multiple implementation of signature::AsyncSigner with various signature
are available.
This would look like:
let certificate = builder.build_async::<_, ecdsa::der::Signature<_>>(&signer).await?;Sourceasync fn build_with_rng_async<S, Signature, R>(
self,
signer: &S,
rng: &mut R,
) -> Result<Self::Output>where
S: AsyncRandomizedSigner<Signature> + Keypair + DynSignatureAlgorithmIdentifier,
S::VerifyingKey: EncodePublicKey,
Signature: SignatureBitStringEncoding,
R: CryptoRng + ?Sized,
async fn build_with_rng_async<S, Signature, R>(
self,
signer: &S,
rng: &mut R,
) -> Result<Self::Output>where
S: AsyncRandomizedSigner<Signature> + Keypair + DynSignatureAlgorithmIdentifier,
S::VerifyingKey: EncodePublicKey,
Signature: SignatureBitStringEncoding,
R: CryptoRng + ?Sized,
Run the object through the signer and build it.
§Notes
When using ECDSA signers, the Signature parameter will need to be explicit
as multiple implementation of signature::AsyncSigner with various signature
are available.
This would look like:
let certificate = builder.build_with_rng_async::<_, ecdsa::der::Signature<_>, _>(&signer, &mut rng).await?;Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".