CryptoProof

Trait CryptoProof 

Source
pub trait CryptoProof {
    // Required methods
    fn proof(&self, payload: Value) -> Result<Proof, Error>;
    fn verify(&self, payload: Value) -> Result<(), Error>;
}
Expand description

A trait to be implemented by every crypto suite

Required Methods§

Source

fn proof(&self, payload: Value) -> Result<Proof, Error>

Create the proof value and add it to the proof object.

The payload is the data to be signed without any proof entry. Caller must make sure all existing proofs are removed prior to passing the payload to this function.

Returns the proof object with the proof value added.

Source

fn verify(&self, payload: Value) -> Result<(), Error>

Verifies that this proof is authenticates with the payload.

The payload is the data to be verified without any proof entry. Caller must make sure all existing proofs are removed prior to passing the payload to this function.

Implementors§