#[non_exhaustive]pub enum ValidationError {
Show 20 variants
Jws(JwsError),
KeyReference(KeyReferenceError),
UnexpectedTyp {
expected: &'static str,
found: String,
},
Payload(Error),
Credential(CredentialError),
SdJwtPayload {
claim: &'static str,
},
KeyResolution {
key: Box<KeyReference>,
source: KeyResolutionError,
},
Signature(VerificationError),
IssuerMismatch {
issuer: Uri,
key: Box<KeyReference>,
},
NotDid {
role: &'static str,
id: String,
},
HolderMismatch {
holder: Uri,
key: Box<KeyReference>,
},
NotYetValid {
not_before: DateTime<Utc>,
now: DateTime<Utc>,
},
Expired {
expired_at: DateTime<Utc>,
now: DateTime<Utc>,
},
IssuedInFuture {
issued_at: DateTime<Utc>,
now: DateTime<Utc>,
},
AudienceMismatch {
expected: String,
found: Option<OneOrMany<String>>,
},
NonceMismatch {
expected: String,
found: Option<String>,
},
StatusUnchecked(String),
Status(StatusError),
SubjectHolderMismatch {
subject: Option<Uri>,
holder: Uri,
},
SdJwt(Box<SdJwtValidationError>),
}vc only.Expand description
Why a credential or presentation JWT did not validate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Jws(JwsError)
The token is not a compact JWS this crate decodes.
KeyReference(KeyReferenceError)
The JWS header names no key this crate can look for: no kid, a kid that is not a
DID URL, a DID URL with a path or DID parameters, a relative kid without a DID issuer.
UnexpectedTyp
The header typ is not the one the profile requires.
Payload(Error)
The payload is not a JSON claims set; the source is the JSON error.
Credential(CredentialError)
The claims do not map to a credential or presentation.
SdJwtPayload
The payload carries _sd_alg, _sd or an array element {"...": "<digest>"}: it is
the issuer-signed JWT of an SD-JWT, whose claims mean something else until its
disclosures are processed, so it is not read as a plain JWT (RFC 8725 §3.12).
SdJwtCredentialValidator of sd_jwt_vc validates it.
KeyResolution
The key the token names could not be resolved.
Fields
key: Box<KeyReference>Where the token says its key is.
source: KeyResolutionErrorWhat went wrong.
Signature(VerificationError)
The signature does not verify under the resolved key.
IssuerMismatch
The issuer of the credential does not control the key that signed it.
Fields
key: Box<KeyReference>Where the token says its key is.
NotDid
The issuer is not a DID, so no key of it can be resolved.
HolderMismatch
The holder of the presentation does not control the key that signed it.
Fields
key: Box<KeyReference>Where the token says its key is.
NotYetValid
The token or credential is not valid yet.
Expired
The token or credential has expired.
IssuedInFuture
The token claims to have been issued in the future.
AudienceMismatch
The aud does not include the expected audience.
NonceMismatch
The nonce is not the expected one.
StatusUnchecked(String)
The credential has a credentialStatus and the validator has no
StatusCheck for it.
Status(StatusError)
The status check failed or found the credential revoked or suspended.
SubjectHolderMismatch
The subject of a presented credential is not the holder presenting it.
Fields
SdJwt(Box<SdJwtValidationError>)
sd-jwt only.A credential secured with SD-JWT, enveloped in a presentation, failed a check of its own: it is not a well-formed SD-JWT credential, or its key binding is missing or wrong. (A check shared with the JWT validators is reported as that check’s own variant.)
Trait Implementations§
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
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<CredentialError> for ValidationError
impl From<CredentialError> for ValidationError
Source§fn from(source: CredentialError) -> Self
fn from(source: CredentialError) -> Self
Source§impl From<JwsError> for ValidationError
impl From<JwsError> for ValidationError
Source§impl From<KeyReferenceError> for ValidationError
impl From<KeyReferenceError> for ValidationError
Source§fn from(source: KeyReferenceError) -> Self
fn from(source: KeyReferenceError) -> Self
Source§impl From<SdJwtValidationError> for ValidationError
impl From<SdJwtValidationError> for ValidationError
Source§fn from(error: SdJwtValidationError) -> Self
fn from(error: SdJwtValidationError) -> Self
Unwraps a shared check’s error; boxes the SD-JWT-specific ones.
Source§impl From<StatusError> for ValidationError
impl From<StatusError> for ValidationError
Source§fn from(source: StatusError) -> Self
fn from(source: StatusError) -> Self
Source§impl From<ValidationError> for DomainLinkageError
Available on crate feature domain-linkage only.
impl From<ValidationError> for DomainLinkageError
domain-linkage only.Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Source§impl From<ValidationError> for LinkedVpError
Available on crate feature linked-vp only.
impl From<ValidationError> for LinkedVpError
linked-vp only.Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Source§impl From<ValidationError> for SdJwtValidationError
Available on crate feature sd-jwt only.
impl From<ValidationError> for SdJwtValidationError
sd-jwt only.