Skip to main content

MessageVerificationExt

Trait MessageVerificationExt 

Source
pub trait MessageVerificationExt {
    const DOMAIN_TAG: DomainTag;

    // Required methods
    fn verification_data(&self) -> Result<Vec<u8>, Error>;
    fn verification(&self) -> &MessageVerification;

    // Provided methods
    fn is_expired(&self) -> bool { ... }
    fn verify_at(&self, network_id: u32, at_ms: u128) -> bool { ... }
    fn verify(&self, network_id: u32) -> 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 Associated Constants§

Source

const DOMAIN_TAG: DomainTag

The message family this type is signed under. Paired with the receiver’s overlay it fixes the SigningDomain of Self::verification.

Required Methods§

Source

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

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_at(&self, network_id: u32, at_ms: u128) -> bool

Verifies the message as of the instant at_ms: its proof was live then, its session was authorized and live then, and the signature was issued for this message family inside the overlay network_id.

Every transport path judges as of now through Self::verify; a relay inbox judges a held message as of the instant its holder received it, so a sender’s session expiring afterwards does not retroactively unverify a message that was valid when held.

Source

fn verify(&self, network_id: u32) -> bool

Verifies that the message is not expired and that the signature was issued for this message family inside the overlay network_id, as of now.

Source

fn signer(&self) -> Did

Get signer did from verification.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§