Signable

Trait Signable 

Source
pub trait Signable {
    // Required method
    fn hash(&self, hasher: &mut Sha256);

    // Provided methods
    fn sign(&self, private_key: &Scalar) -> Result<Vec<u8>, Error> { ... }
    fn verify(&self, signature: &[u8], public_key: &PublicKey) -> bool { ... }
}
Expand description

Trait to encapsulate sign/verify, users only need to impl hash

Required Methods§

Source

fn hash(&self, hasher: &mut Sha256)

Hash this object in a consistent way so it can be signed/verified

Provided Methods§

Source

fn sign(&self, private_key: &Scalar) -> Result<Vec<u8>, Error>

Sign a hash of this object using the passed private key

Source

fn verify(&self, signature: &[u8], public_key: &PublicKey) -> bool

Verify a hash of this object using the passed public key

Implementors§