Trait coins_bip32::ecdsa::signature::RandomizedSigner

source ·
pub trait RandomizedSigner<S> {
    // Required method
    fn try_sign_with_rng(
        &self,
        rng: &mut impl CryptoRngCore,
        msg: &[u8],
    ) -> Result<S, Error>;

    // Provided method
    fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S { ... }
}
Expand description

Sign the given message using the provided external randomness source.

Required Methods§

source

fn try_sign_with_rng( &self, rng: &mut impl CryptoRngCore, 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.

Provided Methods§

source

fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S

Sign the given message and return a digital signature

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl RandomizedSigner<Signature> for SigningKey

source§

fn try_sign_with_rng( &self, rng: &mut impl CryptoRngCore, msg: &[u8], ) -> Result<Signature, Error>

source§

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

source§

fn try_sign_with_rng( &self, rng: &mut impl CryptoRngCore, msg: &[u8], ) -> Result<Signature<C>, Error>

source§

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

source§

fn try_sign_with_rng( &self, rng: &mut impl CryptoRngCore, msg: &[u8], ) -> Result<Signature<C>, Error>

Implementors§