pub fn verify_chain(
records: &[AuditRecord],
checkpoints: &[Checkpoint],
keys: &[TrustedKey],
) -> ChainReportAvailable on crate feature
audit only.Expand description
Verifies records, which must be one chain in seq order, against the
checkpoints written for it, trusting signatures by keys.
Checked, in order, and the first failure is reported:
- every record is of
SCHEMAand of the same chain; - each record’s
hashis the hash of its content; seqrises by exactly one from record to record;- each
previs thehashof the record before it; the first record’s is absent atseq1, and otherwise must equal the hash of an anchor checkpoint atseq − 1— a chain that starts later with no anchor has lost its beginning; - every checkpoint whose
seqis in the range names the hash the record at thatseqhas, and its signature verifies underkeys; - no checkpoint’s
seqlies beyond the last record — one that does proves records were removed from the end.
With keys empty, a signed checkpoint cannot be verified and fails rule 5:
pass the keys, or pass no checkpoints to check the hash chain alone.