MessageVerify

Trait MessageVerify 

Source
pub trait MessageVerify {
    // Required method
    fn verify<M, S, P>(
        message: M,
        signature: S,
        pub_key: Option<P>,
    ) -> Result<Vec<u8>>
       where M: AsRef<[u8]>,
             S: AsRef<[u8]>,
             P: AsRef<[u8]>;
}
Expand description

MessageVerify is a trait for verifying the signature of a message. It is used by the wallet public key to verify the signature of a message.

Required Methods§

Source

fn verify<M, S, P>( message: M, signature: S, pub_key: Option<P>, ) -> Result<Vec<u8>>
where M: AsRef<[u8]>, S: AsRef<[u8]>, P: AsRef<[u8]>,

Verify the signature of a message.

§Arguments
  • message is the message to be verified.
  • signature is the signature of the message.
  • pub_key is the public key of the wallet. Note: this is optional.
§Return
  • Return the public key of the signer if the signature is valid.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§