Trait mina_signer::Signer

source ·
pub trait Signer<H: Hashable> {
    // Required methods
    fn sign(&mut self, kp: &Keypair, input: &H) -> Signature;
    fn verify(&mut self, sig: &Signature, pub_key: &PubKey, input: &H) -> bool;
}
Expand description

Interface for signed objects

Signer interface for signing [Hashable] inputs and verifying Signatures using Keypairs and PubKeys

Required Methods§

source

fn sign(&mut self, kp: &Keypair, input: &H) -> Signature

Sign input (see [Hashable]) using keypair kp and return the corresponding signature.

source

fn verify(&mut self, sig: &Signature, pub_key: &PubKey, input: &H) -> bool

Verify that the signature sig on input (see [Hashable]) is signed with the secret key corresponding to pub_key. Return true if the signature is valid and false otherwise.

Implementors§

source§

impl<H: 'static + Hashable> Signer<H> for Schnorr<H>