lcert_verify.explain

Explain a verdict per locus, so a rejection is actionable rather than opaque.

verify_bundle answers "is this certificate sound?". When the answer is no, the next question is always "where, and by how much?". This module answers that from the certificate's own numbers — it computes nothing new and asserts nothing the verdict did not already establish.

def explain_certificate(cert: dict, *, limit: int = 20) -> dict:

Per-locus breakdown of why a certificate reached its verdict.

Returns the same classification the verdict is derived from, plus the margin arithmetic for each locus, so a reader can see how close a locus was to the boundary rather than only which side of it fell.

def format_explanation(exp: dict, *, limit: int = 10) -> str:

Human-readable rendering, with the actionable part first.