#[non_exhaustive]pub enum VerificationError {
UnsupportedAlgorithm(JwsAlgorithm),
AlgorithmMismatch {
alg: JwsAlgorithm,
key_alg: String,
},
KeyUse(&'static str),
Key(JwkError),
InvalidSignatureLength {
expected: usize,
actual: usize,
},
DerEncodedSignature,
InvalidSignature,
}Expand description
Why a JWS signature did not verify.
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.
UnsupportedAlgorithm(JwsAlgorithm)
The verifier has no implementation of this algorithm, possibly because the Cargo feature that provides it is off.
AlgorithmMismatch
The key’s alg member names a different algorithm than the one being verified.
KeyUse(&'static str)
The key’s use or key_ops member excludes signature verification.
Key(JwkError)
The key cannot be used with this algorithm.
InvalidSignatureLength
The signature does not have the length the algorithm requires.
DerEncodedSignature
An ECDSA signature was given in ASN.1 DER instead of the raw r || s form JWS requires.
InvalidSignature
The signature is well-formed but does not verify under the key.
Trait Implementations§
Source§impl Clone for VerificationError
impl Clone for VerificationError
Source§impl Debug for VerificationError
impl Debug for VerificationError
Source§impl Display for VerificationError
impl Display for VerificationError
impl Eq for VerificationError
Source§impl Error for VerificationError
impl Error for VerificationError
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<JwkError> for VerificationError
impl From<JwkError> for VerificationError
Source§impl From<VerificationError> for ValidationError
Available on crate feature vc only.
impl From<VerificationError> for ValidationError
Available on crate feature
vc only.Source§fn from(source: VerificationError) -> Self
fn from(source: VerificationError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for VerificationError
impl PartialEq for VerificationError
impl StructuralPartialEq for VerificationError
Auto Trait Implementations§
impl Freeze for VerificationError
impl RefUnwindSafe for VerificationError
impl Send for VerificationError
impl Sync for VerificationError
impl Unpin for VerificationError
impl UnsafeUnpin for VerificationError
impl UnwindSafe for VerificationError
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
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
Compare self to
key and return true if they are equal.