#[non_exhaustive]pub enum IncompatibleKeyError {
AlgorithmMismatch {
requested: Algorithm,
declared: Algorithm,
},
IncompatibleAlgorithm {
algorithm: Algorithm,
key_type: KeyType,
},
InsufficientKeyStrength {
minimum_bits: usize,
actual_bits: usize,
context: &'static str,
},
KeySizeMismatch {
required_bits: usize,
actual_bits: usize,
context: &'static str,
},
OperationNotPermitted {
operations: Vec<KeyOperation>,
reason: String,
},
}Expand description
The JWK is well-formed but incompatible with the requested use.
These errors indicate the key is structurally valid but cannot be used
in the requested context. A key producing an IncompatibleKeyError may
be perfectly valid for a different algorithm or operation.
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
Requested algorithm conflicts with the key’s declared alg value.
Fields
IncompatibleAlgorithm
Algorithm is not compatible with the key type or curve.
Fields
InsufficientKeyStrength
Key is too weak for the requested algorithm.
Fields
KeySizeMismatch
Key size does not match the exact size required by the algorithm.
Fields
OperationNotPermitted
Requested operation(s) are not permitted by key metadata or key material capability (for example, a public-only key used for signing).
Fields
§
operations: Vec<KeyOperation>The disallowed operations.
Trait Implementations§
Source§impl Clone for IncompatibleKeyError
impl Clone for IncompatibleKeyError
Source§fn clone(&self) -> IncompatibleKeyError
fn clone(&self) -> IncompatibleKeyError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IncompatibleKeyError
impl Debug for IncompatibleKeyError
Source§impl Display for IncompatibleKeyError
impl Display for IncompatibleKeyError
Source§impl Error for IncompatibleKeyError
impl Error for IncompatibleKeyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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()
Source§impl From<IncompatibleKeyError> for Error
impl From<IncompatibleKeyError> for Error
Source§fn from(e: IncompatibleKeyError) -> Self
fn from(e: IncompatibleKeyError) -> Self
Converts to this type from the input type.
Source§impl From<IncompatibleKeyError> for JwtSimpleKeyConversionError
Available on crate feature jwt-simple only.
impl From<IncompatibleKeyError> for JwtSimpleKeyConversionError
Available on crate feature
jwt-simple only.Source§fn from(e: IncompatibleKeyError) -> Self
fn from(e: IncompatibleKeyError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for IncompatibleKeyError
impl PartialEq for IncompatibleKeyError
impl Eq for IncompatibleKeyError
impl StructuralPartialEq for IncompatibleKeyError
Auto Trait Implementations§
impl Freeze for IncompatibleKeyError
impl RefUnwindSafe for IncompatibleKeyError
impl Send for IncompatibleKeyError
impl Sync for IncompatibleKeyError
impl Unpin for IncompatibleKeyError
impl UnsafeUnpin for IncompatibleKeyError
impl UnwindSafe for IncompatibleKeyError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.