[−][src]Trait lnpbp::single_use_seals::SingleUseSeal
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
Associated type for the witness produced by the single-use-seal close procedure
type Definition
Type that contains seal definition
type Error: Error
Closing and verification errors
Required methods
fn close(&self, over: &Message) -> Result<Self::Witness, Self::Error>
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
fn verify(
&self,
msg: &Message,
witness: &Self::Witness
) -> Result<bool, Self::Error>
&self,
msg: &Message,
witness: &Self::Witness
) -> Result<bool, Self::Error>