Trait coins_bip32::ecdsa::signature::Signer

source ·
pub trait Signer<S> {
    // Required method
    fn try_sign(&self, msg: &[u8]) -> Result<S, Error>;

    // Provided method
    fn sign(&self, msg: &[u8]) -> S { ... }
}
Expand description

Sign the provided message bytestring using Self (e.g. a cryptographic key or connection to an HSM), returning a digital signature.

Required Methods§

source

fn try_sign(&self, 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(&self, msg: &[u8]) -> S

Sign the given message and return a digital signature

Implementations on Foreign Types§

source§

impl Signer<Signature> for SigningKey

source§

fn try_sign(&self, msg: &[u8]) -> Result<Signature, Error>

source§

impl<C> Signer<(Signature<C>, RecoveryId)> for SigningKey<C>

source§

fn try_sign(&self, msg: &[u8]) -> Result<(Signature<C>, RecoveryId), Error>

source§

impl<C> Signer<Signature<C>> for SigningKey<C>

source§

fn try_sign(&self, msg: &[u8]) -> Result<Signature<C>, Error>

source§

impl<C> Signer<Signature<C>> for SigningKey<C>

Sign message using a deterministic ephemeral scalar (k) computed using the algorithm described in RFC6979 § 3.2.

source§

fn try_sign(&self, msg: &[u8]) -> Result<Signature<C>, Error>

source§

impl<C> Signer<SignatureWithOid<C>> for SigningKey<C>

source§

fn try_sign(&self, msg: &[u8]) -> Result<SignatureWithOid<C>, Error>

Implementors§