Skip to main content

Signer

Trait Signer 

Source
pub trait Signer: Sync + Send {
    // Required methods
    fn public_key(&self) -> PublicKey;
    fn sign(&self, data: &[u8]) -> Signature;
    fn compute_vrf_with_proof(&self, _data: &[u8]) -> (Value, Proof);

    // Provided methods
    fn verify(&self, data: &[u8], signature: &Signature) -> bool { ... }
    fn write_to_file(&self, _path: &Path) -> Result<()> { ... }
}
Expand description

Generic signer trait, that can sign with some subset of supported curves.

Required Methods§

Source

fn public_key(&self) -> PublicKey

Source

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

Source

fn compute_vrf_with_proof(&self, _data: &[u8]) -> (Value, Proof)

Provided Methods§

Source

fn verify(&self, data: &[u8], signature: &Signature) -> bool

Source

fn write_to_file(&self, _path: &Path) -> Result<()>

Used by test infrastructure, only implement if make sense for testing otherwise raise unimplemented.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§