Trait commonware_p2p::crypto::Crypto

source ·
pub trait Crypto:
    Send
    + Sync
    + Clone
    + 'static {
    // Required methods
    fn me(&self) -> PublicKey;
    fn sign(&mut self, data: Vec<u8>) -> Signature;
    fn validate(public_key: &PublicKey) -> bool;
    fn verify(
        data: Vec<u8>,
        public_key: &PublicKey,
        signature: &Signature,
    ) -> bool;
}

Required Methods§

source

fn me(&self) -> PublicKey

source

fn sign(&mut self, data: Vec<u8>) -> Signature

source

fn validate(public_key: &PublicKey) -> bool

source

fn verify(data: Vec<u8>, public_key: &PublicKey, signature: &Signature) -> bool

Object Safety§

This trait is not object safe.

Implementors§