Skip to main content

MessageVerificationExt

Trait MessageVerificationExt 

Source
pub trait MessageVerificationExt {
    // Required methods
    fn verification_data(&self) -> Result<Vec<u8>>;
    fn verification(&self) -> &MessageVerification;

    // Provided methods
    fn is_expired(&self) -> bool { ... }
    fn verify(&self) -> bool { ... }
    fn signer(&self) -> Did { ... }
}
Expand description

This trait helps a struct with MessageVerification field to verify itself. It also provides a signer method to let receiver know who sent the message.

Required Methods§

Source

fn verification_data(&self) -> Result<Vec<u8>>

Give the data to be verified.

Source

fn verification(&self) -> &MessageVerification

Give the verification field for verifying.

Provided Methods§

Source

fn is_expired(&self) -> bool

Checks whether the message is expired.

Source

fn verify(&self) -> bool

Verifies that the message is not expired and that the signature is valid.

Source

fn signer(&self) -> Did

Get signer did from verification.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§