pub trait Signable: AsRef<[u8]> {
    // Required methods
    fn sign(&self, signing_key: &SigningKeyPair) -> Signature;
    fn verify(
        &self,
        public_key: &SigningPublicKey,
        signature: &Signature
    ) -> Result<(), CryptoError>;
}
Expand description

Provides the methods necessary to sign and verify a piece of data with a SigningKeyPair. This trait should be explicitly implemented on types that are intended to be signed.

It requires AsRef<[u8]> so that we can accept impl Signable in the public client API but send SignableBytes over the network. This requirement may be removed in the future.

Required Methods§

source

fn sign(&self, signing_key: &SigningKeyPair) -> Signature

source

fn verify( &self, public_key: &SigningPublicKey, signature: &Signature ) -> Result<(), CryptoError>

Implementors§