Skip to main content

AsyncRandomizedSigner

Trait AsyncRandomizedSigner 

Source
pub trait AsyncRandomizedSigner<S> {
    // Required method
    async fn try_sign_with_rng_async<R: TryCryptoRng + ?Sized>(
        &self,
        rng: &mut R,
        msg: &[u8],
    ) -> Result<S, Error>;

    // Provided method
    async fn sign_with_rng_async<R: CryptoRng + ?Sized>(
        &self,
        rng: &mut R,
        msg: &[u8],
    ) -> S { ... }
}
Expand description

Sign the given message using the provided external randomness source.

Required Methods§

Source

async fn try_sign_with_rng_async<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[u8], ) -> Result<S, Error>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong.

The main intended use case for signing errors is when communicating with external signers, e.g. cloud KMS, HSMs, or other hardware tokens.

§Errors

Returns implementation-specific errors in the event signing failed (e.g. KMS or HSM communication error), or if the provided rng experiences an internal failure.

Provided Methods§

Source

async fn sign_with_rng_async<R: CryptoRng + ?Sized>( &self, rng: &mut R, msg: &[u8], ) -> S

Sign the given message and return a digital signature.

§Panics

In the event of a signing error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S, T> AsyncRandomizedSigner<S> for T
where T: RandomizedSigner<S>,

Available on crate feature rand_core only.