Enum jwt_compact::ValidationError[][src]

#[non_exhaustive]
pub enum ValidationError {
    AlgorithmMismatch {
        expected: String,
        actual: String,
    },
    InvalidSignatureLen {
        expected: usize,
        actual: usize,
    },
    MalformedSignature(Error),
    InvalidSignature,
    MalformedClaims(Error),
    MalformedCborClaims(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

Fields

expected: String

Expected algorithm name.

actual: String

Actual algorithm in the token.

Algorithm mentioned in the token header differs from invoked one.

InvalidSignatureLen

Fields

expected: usize

Expected signature length.

actual: usize

Actual signature length.

Token signature has invalid byte length.

MalformedSignature(Error)

Tuple Fields

0: Error

Token signature is malformed.

InvalidSignature

Token signature has failed verification.

MalformedClaims(Error)

Tuple Fields

0: Error

Token claims cannot be deserialized from JSON.

MalformedCborClaims(Error)

Tuple Fields

0: Error
This is supported on crate feature serde_cbor only.

Token claims cannot be deserialized from CBOR.

NoClaim(Claim)

Tuple Fields

0: 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

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.