Skip to main content

Signer

Trait Signer 

Source
pub trait Signer {
    type Signature: Signature;

    // Required methods
    fn sign(&self, message: &[u8]) -> Self::Signature;
    fn public_key(&self) -> <Self::Signature as Signature>::PublicKey;
}
Expand description

A trait for types that can sign messages.

Required Associated Types§

Source

type Signature: Signature

The signature type produced by this signer.

Required Methods§

Source

fn sign(&self, message: &[u8]) -> Self::Signature

Signs the given message and returns a signature.

Source

fn public_key(&self) -> <Self::Signature as Signature>::PublicKey

Returns the public key corresponding to this signer.

Implementors§

Source§

impl Signer for Bls12381PrivateKey

Available on crate feature bls only.
Source§

impl Signer for Ed25519PrivateKey

Available on crate feature ed25519 only.
Source§

impl Signer for Secp256k1PrivateKey

Available on crate feature secp256k1 only.
Source§

impl Signer for Secp256r1PrivateKey

Available on crate feature secp256r1 only.