identity_credential/validator/sd_jwt/
error.rs1use crate::validator::JwtValidationError;
5
6#[derive(Debug, thiserror::Error, strum::IntoStaticStr)]
8#[non_exhaustive]
9pub enum KeyBindingJwtError {
10 #[error("KB-JWT is invalid")]
12 JwtValidationError(#[from] JwtValidationError),
13
14 #[error("Deserialization error")]
16 DeserializationError(String),
17
18 #[error("SdJwt Error {0}")]
20 SdJwtError(#[from] sd_jwt_payload::Error),
21
22 #[error("the `_sd_hash` value of the KB-JWT does not match the derived value from the provided SD-JWT")]
24 InvalidDigest,
25
26 #[error("provided nonce does not match the KB-JWT nonce claim")]
28 InvalidNonce,
29
30 #[error("provided audience value does not match the KB-JWT `aud` claim")]
32 AudienceMismatch,
33
34 #[error("KB-JWT `iat` value is invalid, {0}")]
36 IssuanceDate(String),
37
38 #[error("the provided SD-JWT does not include a KB-JWT")]
40 MissingKeyBindingJwt,
41
42 #[error("header `typ` value is missing or not equal to `kb+jwt`")]
44 InvalidHeaderTypValue,
45}