Skip to main content

verify_chain

Function verify_chain 

Source
pub fn verify_chain(public: &PublicIdentity, entries: &[Entry]) -> Result<()>
Expand description

Verifies a whole chain of entries from the start against public.

A chain proves nothing is missing before its last entry, not that its last entry is the last one written: a log cut short at the end is still a valid chain. To catch that, compare the last entry’s index and digest with the ones the device last reported, in a heartbeat or a telemetry snapshot.

§Arguments

  • public - the public identity expected to have signed the log.
  • entries - the log’s entries, oldest first.

§Returns

Ok(()) if every entry is in sequence, correctly chained, and authentic.

§Errors

Returns Error::Auth at the first entry that is out of sequence, broken in the chain, or not authentically signed.