[][src]Trait client_side_validation::single_use_seals::SingleUseSeal

pub trait SingleUseSeal {
    type Witness;
    type Definition;
    type Error: Error;
    pub fn close(&self, over: &Message) -> Result<Self::Witness, Self::Error>;
pub fn verify(
        &self,
        msg: &Message,
        witness: &Self::Witness
    ) -> Result<bool, Self::Error>; }

Single-use-seal trait: implement for a data structure that will hold a single-use-seal definition and will contain a business logic for closing seal over some message and verification of the seal against the message and witness.

NB: It is recommended that single-use-seal instances to be instantiated not by a constructor, but by a factory, i.e. "seal medium": data type implementing either SealMedium or [AsyncSealMedium] traits.

Associated Types

type Witness[src]

Associated type for the witness produced by the single-use-seal close procedure

type Definition[src]

Type that contains seal definition

type Error: Error[src]

Closing and verification errors

Loading content...

Required methods

pub fn close(&self, over: &Message) -> Result<Self::Witness, Self::Error>[src]

NB: Closing of the seal MUST not change the internal state of the seal itself; all the data produced by the process must be placed into the returned Witness type

pub fn verify(
    &self,
    msg: &Message,
    witness: &Self::Witness
) -> Result<bool, Self::Error>
[src]

Loading content...

Implementors

Loading content...