pub enum Error {
Show 28 variants
InvalidSignature,
UnknownKey,
UnknownAlg,
InvalidPrior,
TimestampPast,
TimestampFuture,
KeyRevoked,
MalformedPayload,
DuplicateKey,
ThresholdNotMet,
RecoveryNotDesignated,
AccountRecoverable,
UnrecoverablePrincipal,
StateMismatch,
ChainBroken,
HashAlgMismatch,
EmptyMultihash,
UnauthorizedAction,
NoActiveKeys,
UnsupportedAlgorithm(String),
EmptyCommit,
CommitNotLast,
MissingCommit,
CommitMismatch,
TransitoryStateReference,
MalformedDigest(&'static str),
DigestLengthMismatch {
alg: HashAlg,
expected: usize,
actual: usize,
},
Coz(Error),
}Expand description
Cyphr error type covering all error conditions from SPEC §17.
Variants§
InvalidSignature
Signature does not verify against claimed key.
UnknownKey
Referenced key (tmb or id) not in current KS.
UnknownAlg
Client doesn’t know or support the algorithm.
InvalidPrior
pre does not match current AS.
TimestampPast
now < latest known PS timestamp.
TimestampFuture
now > server time + tolerance.
KeyRevoked
Signing key has rvk ≤ now.
MalformedPayload
Missing required fields for coz type.
DuplicateKey
key/create for key already in KS.
ThresholdNotMet
Signing keys do not meet required weight (Level 5+).
RecoveryNotDesignated
Agent not registered via recovery/designate.
AccountRecoverable
Recovery attempted while regular keys are active.
UnrecoverablePrincipal
No active keys AND no designated recovery agents.
StateMismatch
Computed PS does not match claimed PS.
ChainBroken
pre references do not form valid chain to known state.
HashAlgMismatch
Multihash variant computed with wrong algorithm.
EmptyMultihash
MultihashDigest contains no variants (internal invariant violation).
Action typ not permitted for this key (Level 5+).
NoActiveKeys
No active keys remain in principal.
UnsupportedAlgorithm(String)
Algorithm not supported.
EmptyCommit
Attempted to finalize an empty commit (no cozies).
CommitNotLast
commit field appears on a non-terminal coz in the commit array.
Per SPEC §4.4, commit MUST only appear on the last coz.
MissingCommit
Terminal coz is missing the required commit field.
Per SPEC §4.4, the last coz MUST include "commit":<CS>.
CommitMismatch
commit field value does not match independently computed CS.
Per SPEC §4.4, the commit value must equal MR(AS, DS?).
TransitoryStateReference
External reference to transitory (unfinalized) state root.
Per SPEC §4.2.1, transitory state during a pending commit cannot be referenced by external cozies until the commit is finalized.
MalformedDigest(&'static str)
Malformed tagged digest string (missing separator, invalid base64).
DigestLengthMismatch
Digest length does not match the algorithm’s expected output size.
Fields
Coz(Error)
Underlying Coz error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()