Skip to main content

IntegrityChain

Trait IntegrityChain 

Source
pub trait IntegrityChain: Send + Sync {
    // Required methods
    fn sign_event(
        &self,
        prev_signature: &EventSignature,
        event: &Event,
    ) -> Result<EventSignature, IntegrityError>;
    fn verify_chain(
        &self,
        events: &[(Event, EventSignature)],
    ) -> IntegrityResult;
}
Expand description

Tamper-evident chaining sink for events.

Required Methods§

Source

fn sign_event( &self, prev_signature: &EventSignature, event: &Event, ) -> Result<EventSignature, IntegrityError>

Compute the signature over prev_signature || canonical_event_bytes.

Source

fn verify_chain(&self, events: &[(Event, EventSignature)]) -> IntegrityResult

Verify a contiguous in-order event stream. Returns Valid if every event’s signature matches the chained recomputation, else Broken with the first failure.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§