Skip to main content
This is unreleased documentation for the main (development) branch of crypto-glue.

RandomizedSigner

Trait RandomizedSigner 

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

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

Sign the given message using the provided external randomness source.

Required Methods§

Source

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

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

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

Sign the given message and return a digital signature

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<C> RandomizedSigner<Signature<C>> for SigningKey<C>

Available on crate feature der only.
Source§

fn try_sign_with_rng<R>( &self, rng: &mut R, msg: &[u8], ) -> Result<Signature<C>, Error>
where R: TryCryptoRng + ?Sized,

Source§

impl<C> RandomizedSigner<Signature<C>> for SigningKey<C>

Source§

fn try_sign_with_rng<R>( &self, rng: &mut R, msg: &[u8], ) -> Result<Signature<C>, Error>
where R: TryCryptoRng + ?Sized,

Source§

impl<D> RandomizedSigner<Signature> for BlindedSigningKey<D>

Source§

fn try_sign_with_rng<R>( &self, rng: &mut R, msg: &[u8], ) -> Result<Signature, Error>
where R: TryCryptoRng + ?Sized,

Source§

impl<D> RandomizedSigner<Signature> for SigningKey<D>

Source§

fn try_sign_with_rng<R>( &self, rng: &mut R, msg: &[u8], ) -> Result<Signature, Error>
where R: TryCryptoRng + ?Sized,

Implementors§

Source§

impl<D> RandomizedSigner<Signature> for crypto_glue::rsa::pkcs1v15::SigningKey<D>
where D: Digest,