pub enum DigestVerification {
Verified,
Mismatch {
expected: String,
actual: String,
},
Unreadable {
reason: String,
},
NotFileProvenance,
}Expand description
The outcome of verifying one file-provenance digest against the bytes it
addresses (SPEC.md §6.2). Evidence-carrying rather than a bare bool, so a
failure says exactly what diverged.
Variants§
Verified
The declared digest equals the sha256 of the addressed bytes.
Mismatch
The addressed bytes are readable, but their sha256 does not match the
declared digest — tampering, a source that changed, or a mis-declared
range. Carries both digests so a report can show the divergence.
expected is what the provider declared; actual is what the bytes
hash to now.
Unreadable
The addressed bytes could not be read at all: a missing file, a uri
that is not a resolvable local file://, a range the grammar does not
define, or file provenance carrying no uri/digest to check. Carries a
human-readable reason. Silence is not validity — an unreadable source is
a failure to confirm, never a pass.
NotFileProvenance
The provenance does not address file bytes (type != "file"), so there
is nothing on disk to re-read and F5 does not bind it (§6.2).
Implementations§
Source§impl DigestVerification
impl DigestVerification
Sourcepub fn is_verified(&self) -> bool
pub fn is_verified(&self) -> bool
Whether the addressed bytes hashed exactly to the declared digest.
Trait Implementations§
Source§impl Clone for DigestVerification
impl Clone for DigestVerification
Source§fn clone(&self) -> DigestVerification
fn clone(&self) -> DigestVerification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more