Enum jwt_compact::jwk::JwkError
source · #[non_exhaustive]pub enum JwkError {
NoField(String),
UnexpectedKeyType {
expected: KeyType,
actual: KeyType,
},
UnexpectedValue {
field: String,
expected: String,
actual: String,
},
UnexpectedLen {
field: String,
expected: usize,
actual: usize,
},
MismatchedKeys,
Custom(Error),
}
Expand description
Errors that can occur when transforming a JsonWebKey
into the presentation specific for
a crypto backend, using the TryFrom
trait.
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.
NoField(String)
Required field is absent from JWK.
UnexpectedKeyType
Key type (the kty
field) is not as expected.
UnexpectedValue
Fields
JWK field has an unexpected value.
UnexpectedLen
Fields
JWK field has an unexpected byte length.
MismatchedKeys
Signing and verifying keys do not match.
Custom(Error)
Custom error specific to a crypto backend.
Implementations§
Trait Implementations§
source§impl Error for JwkError
impl Error for JwkError
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 JwkError
impl Send for JwkError
impl Sync for JwkError
impl Unpin for JwkError
impl UnwindSafe for JwkError
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