#[non_exhaustive]pub enum ValidationError {
Show 28 variants
InvalidSaid {
expected: Said,
actual: Said,
},
BrokenChain {
sequence: u128,
referenced: Said,
actual: Said,
},
InvalidSequence {
expected: u128,
actual: u128,
},
CommitmentMismatch {
sequence: u128,
},
SignatureFailed {
sequence: u128,
},
ThresholdNotSatisfiable {
sequence: u128,
reason: String,
},
InvalidBackerDelta {
sequence: u128,
reason: String,
},
BackerRoleFlip {
sequence: u128,
reason: String,
},
AsymmetricKeyRotation {
sequence: u128,
prior_next_count: usize,
new_key_count: usize,
},
DelegatorSealNotFound {
sequence: u128,
delegator_aid: String,
},
DelegateSourceSealMissing {
sequence: u128,
},
SealBackRefMismatch {
sequence: u128,
},
DelegatorLookupMissing {
sequence: u128,
},
NotInception,
EmptyKel,
MultipleInceptions,
Serialization(String),
MalformedSequence {
raw: String,
},
InvalidKey(String),
AbandonedIdentity {
sequence: u128,
},
EstablishmentOnly {
sequence: u128,
},
NonTransferable,
DuplicateBacker {
aid: String,
},
InvalidBackerThreshold {
bt: u64,
backer_count: usize,
},
MissingTimestamp {
sequence: u128,
},
NonMonotonicTimestamp {
sequence: u128,
prev: String,
curr: String,
},
RotationCooldown {
sequence: u128,
interval_secs: i64,
min_secs: i64,
},
ClockSkew {
sequence: u128,
skew_secs: i64,
tolerance_secs: i64,
},
}Expand description
Errors specific to KEL validation.
These errors represent protocol invariant violations. They indicate structural corruption or attack, not recoverable conditions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidSaid
SAID (Self-Addressing Identifier) doesn’t match content hash.
Fields
BrokenChain
Event references wrong previous event.
Fields
InvalidSequence
Sequence number is not monotonically increasing.
Fields
CommitmentMismatch
Pre-rotation commitment doesn’t match the new current key.
SignatureFailed
Cryptographic signature verification failed for an event.
ThresholdNotSatisfiable
A threshold (kt, nt, or bt) is structurally unsatisfiable against
the list it governs — e.g. kt=5 over a single key, or a weighted
clause whose length differs from the key-list length.
Fields
InvalidBackerDelta
A rotation’s backer delta is invalid: a br (cut) entry isn’t in the
prior backer set, or a ba (add) entry duplicates a surviving backer.
Fields
BackerRoleFlip
A rotation flips the registrar-backer role (RB <-> NRB) while
retaining prior backers via a partial br/ba delta. RB and NRB
carry different backer-list semantics, so a surviving backer would be
governed by semantics it was never admitted under. A role flip must
rebuild b[] — every prior backer cut (F-23).
Fields
AsymmetricKeyRotation
Rotation event’s key-list size differs from the prior next-commitment list. Properly expressing this case requires CESR indexed-signature type codes so verified indices can be mapped distinctly against prior and current key lists. Until that lands, such rotations are rejected.
Fields
DelegatorSealNotFound
A delegated event (dip / drt) references a delegator but no
matching seal could be found in the delegator’s KEL.
Fields
DelegateSourceSealMissing
A delegated event (dip / drt) has no delegate-side source seal
(-G couple). The delegator anchored it, but the event itself doesn’t
point back at that anchoring event — a one-directional (and therefore
non-keripy-interoperable, weakly-bound) delegation. Bilateral required.
SealBackRefMismatch
A delegated event’s source seal (-G couple) points at a different
delegator event than the one that actually anchored it. The bilateral
binding is broken: the delegate claims anchoring location L while the
delegator’s Seal::KeyEvent lives at L′ ≠ L.
DelegatorLookupMissing
A delegated event was submitted but no DelegatorKelLookup was
provided. Use validate_kel_with_lookup when processing KELs that
contain dip or drt events.
NotInception
The first event in a KEL must be an Inception event.
EmptyKel
The KEL contains no events.
MultipleInceptions
More than one Inception event was found in the KEL.
Serialization(String)
JSON serialization or deserialization failed.
MalformedSequence
A sequence field could not be parsed as a valid hex number.
InvalidKey(String)
The key encoding prefix is unsupported or malformed.
AbandonedIdentity
The identity has been abandoned (empty next commitment) and no more events are allowed.
EstablishmentOnly
An interaction event was found in an establishment-only KEL.
NonTransferable
The identity is non-transferable (inception had empty next commitments).
DuplicateBacker
A backer AID appears more than once in the backer list.
InvalidBackerThreshold
The backer threshold is inconsistent with the backer list size.
MissingTimestamp
A policy-only variant: an establishment event is missing the dt
field, so the cooldown cannot be enforced. Structural validation
(validate_kel) permits missing dt; the policy validator
(validate_kel_with_policy) does not.
NonMonotonicTimestamp
Two consecutive events have non-monotonic dt.
Fields
RotationCooldown
Two rotations happened closer together than the configured cooldown allows (and the event is not an emergency override).
Fields
ClockSkew
An event’s dt is beyond the configured clock-skew tolerance.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
impl Eq for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
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()
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
Source§fn eq(&self, other: &ValidationError) -> bool
fn eq(&self, other: &ValidationError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.