#[non_exhaustive]pub enum ValidationError {
Show 20 variants
Jws(JwsError),
MissingKid,
InvalidKid {
kid: String,
source: DidError,
},
KidWithParameters(DidUrl),
UnexpectedTyp {
expected: &'static str,
found: String,
},
Payload(String),
Credential(CredentialError),
KeyResolution {
kid: DidUrl,
source: KeyResolutionError,
},
Signature(VerificationError),
IssuerMismatch {
issuer: Uri,
kid: DidUrl,
},
NotDid {
role: &'static str,
id: String,
},
HolderMismatch {
holder: Uri,
kid: DidUrl,
},
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,
},
}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.
MissingKid
The JWS header has no kid, so the signing key cannot be found.
InvalidKid
The kid is not a DID URL naming a verification method.
KidWithParameters(DidUrl)
The kid carries a path or DID parameters. versionId and versionTime could select a
document version that still lists a retired key, so only did:…#fragment keys are
accepted.
UnexpectedTyp
The header typ is not the one the profile requires.
Payload(String)
The payload is not a JSON claims set.
Credential(CredentialError)
The claims do not map to a credential or presentation.
KeyResolution
The key kid names could not be resolved.
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.
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.
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.
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<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 SdJwtValidationError
Available on crate feature sd-jwt only.
impl From<ValidationError> for SdJwtValidationError
sd-jwt only.