pub enum ChainError {
MalformedHash,
Mismatch {
index: u64,
},
Unverifiable,
KeyUnavailable,
}Expand description
Errors from computing or verifying a hash chain.
Variants§
MalformedHash
A stored hex-encoded chain hash was not exactly 64 hex characters.
Mismatch
A chain link recomputed under a known key (current or a previous rotation-window
epoch) did not match the stored value at index within the chained region — this is a
definite tamper verdict: the key resolved correctly at the first chained entry, so a
later mismatch means the content itself was altered, reordered, or deleted-and-replaced.
Unverifiable
Neither the current epoch’s key nor any previous-epoch key in the rotation window produced a valid link for the first chained entry. This is genuinely ambiguous — it could be tamper under an unknown key, or a legitimate session that predates the rotation window — so it fails closed without asserting either. Per NFR-004 this is never downgraded to trusted-legacy: only a file with no chain metadata anywhere is legacy.
No chain key is available at all (e.g. the vault key was never provisioned, or the vault is unreachable) for a file that carries chain metadata. Per NFR-004 this is a failure, never a silent skip.
Trait Implementations§
Source§impl Debug for ChainError
impl Debug for ChainError
Source§impl Display for ChainError
impl Display for ChainError
impl Eq for ChainError
Source§impl Error for ChainError
impl Error for ChainError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()