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§
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
Object Safety§
This trait is not object safe.