#[non_exhaustive]pub enum SdJwtError {
NotAnSdJwt,
Disclosure(DisclosureError),
MalformedJwt,
PayloadNotAnObject,
UnsupportedHashAlg(String),
UnusedDisclosures(usize),
DuplicateDigest(String),
ClaimCollision(String),
}Expand description
Anything that can go wrong reading an SD-JWT.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotAnSdJwt
Fewer than two ~-separated segments, so not an SD-JWT at all.
Disclosure(DisclosureError)
A disclosure segment could not be read.
MalformedJwt
The issuer-signed JWT is not three dot-separated parts.
PayloadNotAnObject
The JWT payload is not a JSON object.
UnsupportedHashAlg(String)
_sd_alg names a hash function this does not implement.
Carried rather than defaulted: clause 4.1.1 permits the claim to be
absent and to mean sha-256, but a present value naming something else
must not be read as if it said sha-256.
UnusedDisclosures(usize)
A disclosure was supplied whose digest appears nowhere in the token.
Clause 7.1 step 4: every disclosure must be used. The count is reported rather than the disclosure itself, which carries a claim value.
DuplicateDigest(String)
The same digest appeared more than once.
RFC 9901 clause 4.1: “The same digest value MUST NOT appear more than once in the SD-JWT.” Repetition is how a token smuggles a second meaning past a reader that de-duplicates, so it is refused rather than collapsed.
ClaimCollision(String)
A disclosure would overwrite a claim already present in cleartext.
Clause 7.1 makes this a rejection condition: the token would otherwise have two values for one claim and the reader would pick one.
Trait Implementations§
Source§impl Debug for SdJwtError
impl Debug for SdJwtError
Source§impl Display for SdJwtError
impl Display for SdJwtError
impl Eq 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()