#[non_exhaustive]pub enum CodecError {
Malformed,
SignatureMismatch,
Expired,
Crypto(String),
Serde(Error),
MissingKid,
UnknownKid(String),
}Expand description
Errors returned by TokenMinter::mint and TokenVerifier::verify.
A coarse-grained shape: callers usually only care whether the token was
rejected, not why. R007-T4 lands the workspace-wide error hierarchy and
this enum is re-exported from there. The crypto-library mapping (a
pasetors::errors::Error → CodecError) lives with the concrete codecs in
cheers-verify/cheers-server, since the orphan rule forbids it here without
pulling a crypto dependency into this keyless crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Malformed
Token bytes did not parse as the expected format.
SignatureMismatch
Signature / MAC / AEAD tag did not verify against the key.
Expired
Token parsed and verified but expires_at has passed.
Crypto(String)
Underlying crypto library failure (key invalid, RNG, …).
Serde(Error)
JSON (de)serialization of the claim payload failed.
MissingKid
The wire convention requires kid in the PASETO footer (R592-B7) —
this token has no footer at all.
UnknownKid(String)
The footer carries a kid the verifier doesn’t recognize/trust.
Trait Implementations§
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
Source§impl Error for CodecError
impl Error for CodecError
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()