Trait radicle_crypto::Signer

source ·
pub trait Signer: Send + Sync {
    // Required methods
    fn public_key(&self) -> &PublicKey;
    fn sign(&self, msg: &[u8]) -> Signature;
    fn try_sign(&self, msg: &[u8]) -> Result<Signature, SignerError>;
}

Required Methods§

source

fn public_key(&self) -> &PublicKey

Return this signer’s public/verification key.

source

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

Sign a message and return the signature.

source

fn try_sign(&self, msg: &[u8]) -> Result<Signature, SignerError>

Sign a message and return the signature, or fail if the signer was unable to produce a signature.

Implementations on Foreign Types§

source§

impl<T> Signer for Box<T>
where T: Signer + ?Sized,

source§

fn public_key(&self) -> &PublicKey

source§

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

source§

fn try_sign(&self, msg: &[u8]) -> Result<Signature, SignerError>

Implementors§