Enum jwt_compact::ValidationError
source · #[non_exhaustive]pub enum ValidationError {
AlgorithmMismatch {
expected: String,
actual: String,
},
InvalidSignatureLen {
expected: usize,
actual: usize,
},
MalformedSignature(Error),
InvalidSignature,
MalformedClaims(Error),
MalformedCborClaims(Error<Error>),
NoClaim(Claim),
Expired,
NotMature,
}
Expand description
Errors that can occur during token validation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AlgorithmMismatch
Algorithm mentioned in the token header differs from invoked one.
InvalidSignatureLen
Token signature has invalid byte length.
MalformedSignature(Error)
Token signature is malformed.
InvalidSignature
Token signature has failed verification.
MalformedClaims(Error)
Token claims cannot be deserialized from JSON.
MalformedCborClaims(Error<Error>)
Available on crate feature
ciborium
only.Token claims cannot be deserialized from CBOR.
NoClaim(Claim)
Claim requested during validation is not present in the token.
Expired
Token has expired.
NotMature
Token is not yet valid as per nbf
claim.
Trait Implementations§
source§impl Debug for ValidationError
impl Debug for ValidationError
source§impl Display for ValidationError
impl Display for ValidationError
source§impl Error for ValidationError
impl Error for ValidationError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin 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
Mutably borrows from an owned value. Read more