#[non_exhaustive]pub enum SdJwtError {
Show 16 variants
Jws(JwsError),
Format(String),
InvalidDisclosure {
disclosure: String,
reason: String,
},
DuplicateDisclosure(String),
Payload(String),
UnsupportedHashAlgorithm(String),
DuplicateDigest(String),
UnusedDisclosure(String),
WrongDisclosureKind {
disclosure: String,
expected: &'static str,
},
ReservedClaimName(String),
DuplicateClaim {
name: String,
path: ClaimPath,
},
MissingParentDisclosure {
disclosure: String,
parent: String,
},
NoSuchClaim(ClaimPath),
NotConcealable {
path: ClaimPath,
reason: String,
},
TooDeep {
max: usize,
},
KeyBinding(String),
}sd-jwt only.Expand description
Why an SD-JWT could not be parsed, processed, selected from or built.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Jws(JwsError)
The issuer-signed JWT or the key binding JWT is not a compact JWS this crate decodes.
Format(String)
The compact serialization is malformed: no ~, an empty disclosure.
InvalidDisclosure
A disclosure is not base64url of a JSON array of the right shape.
DuplicateDisclosure(String)
The same disclosure is given twice.
Payload(String)
The issuer-signed JWT payload is not a JSON object, or _sd, ... or _sd_alg is
malformed.
UnsupportedHashAlgorithm(String)
The _sd_alg names a hash algorithm this crate does not implement.
DuplicateDigest(String)
A digest appears more than once in the payload, directly or through disclosures.
UnusedDisclosure(String)
A disclosure matches no digest in the payload or in another disclosure.
WrongDisclosureKind
A disclosure of the wrong kind matches a digest: an array element disclosure in _sd,
or an object property disclosure in an array.
Fields
ReservedClaimName(String)
A disclosure names the reserved claim _sd or ....
DuplicateClaim
A disclosure names a claim that already exists at the level of its _sd.
MissingParentDisclosure
A disclosure was selected without the disclosure whose value references it.
Fields
NoSuchClaim(ClaimPath)
A path to conceal or disclose selects no claim.
NotConcealable
A claim cannot be made selectively disclosable: it is _sd or ..., or a profile
forbids it.
TooDeep
The claims nest deeper than SdJwtBuilder::MAX_DEPTH
containers: claims to issue, which no parser of this crate would read back, or claims
being processed, through the payload and the disclosures nested in it.
KeyBinding(String)
The key binding JWT is present where an SD-JWT without key binding was expected, or missing.
Trait Implementations§
Source§impl Debug for SdJwtError
impl Debug for SdJwtError
Source§impl Display for SdJwtError
impl Display for SdJwtError
Source§impl Error for SdJwtError
impl Error for SdJwtError
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()