#[non_exhaustive]pub enum JwkError {
MissingMember(&'static str),
InvalidBase64Url(&'static str),
UnexpectedKeyType {
expected: &'static str,
kty: String,
crv: Option<String>,
},
UnsupportedKeyType {
kty: String,
crv: Option<String>,
},
InvalidKey {
key: &'static str,
reason: String,
},
InvalidKeyLength {
key: &'static str,
expected: usize,
actual: usize,
},
InvalidMultikey(String),
UnsupportedMulticodec(u64),
KeyMismatch {
expected: KeyType,
},
FeatureDisabled {
key: &'static str,
feature: &'static str,
},
DecodingKey(Error),
}Expand description
Why a Jwk cannot be built, or cannot be used the way it was asked to.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingMember(&'static str)
A member the key type requires is absent.
InvalidBase64Url(&'static str)
A member is not valid base64url without padding.
UnexpectedKeyType
The key has a different type than the operation needs, for example an RSA key where an Ed25519 key was expected.
Fields
UnsupportedKeyType
The key type or curve is not one this crate supports.
InvalidKey
The key material does not decode to a valid key: wrong length, not on the curve, even modulus, and so on.
InvalidKeyLength
The key material has the wrong length for its type: a 31-byte Ed25519 key, say.
Fields
InvalidMultikey(String)
A Multikey (publicKeyMultibase) value is not base58btc multibase with a complete
multicodec header.
UnsupportedMulticodec(u64)
A Multikey value carries a public key type this crate cannot read.
KeyMismatch
The encoded key is valid but not of the KeyType that was expected.
FeatureDisabled
Support for this key type is compiled out; enable the named Cargo feature.
Fields
DecodingKey(Error)
jsonwebtoken rejected the key material; the source is its error.
Trait Implementations§
impl Eq for JwkError
Source§impl Error for JwkError
impl Error for JwkError
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()
Source§impl From<JwkError> for IdentityError
impl From<JwkError> for IdentityError
Source§impl From<JwkError> for VerificationError
impl From<JwkError> for VerificationError
Source§impl From<JwkError> for DidKeyError
Available on crate feature did-key and (crate features did-jwk or did-key or did-web) only.
impl From<JwkError> for DidKeyError
did-key and (crate features did-jwk or did-key or did-web) only.impl StructuralPartialEq for JwkError
Auto Trait Implementations§
impl !RefUnwindSafe for JwkError
impl !UnwindSafe for JwkError
impl Freeze for JwkError
impl Send for JwkError
impl Sync for JwkError
impl Unpin for JwkError
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.