#[non_exhaustive]pub enum JwsError {
InvalidFormat {
parts: usize,
},
InvalidBase64Url {
part: &'static str,
},
InvalidHeader {
reason: String,
source: Option<Error>,
},
UnsupportedAlgorithm(String),
UnsupportedCritical(Vec<String>),
UnencodedPayload,
InvalidPayload {
reason: String,
source: Option<Error>,
},
AlgorithmMismatch {
header: JwsAlgorithm,
signer: JwsAlgorithm,
},
Signer(SignError),
}Expand description
Why a compact JWS could not be decoded or produced.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidFormat
The input is not three base64url parts separated by ..
InvalidBase64Url
A part is not valid base64url without padding.
InvalidHeader
The protected header is not a JSON object with the expected members. The source is the JSON error, when there is one.
UnsupportedAlgorithm(String)
The header alg is missing or not a JwsAlgorithm.
UnsupportedCritical(Vec<String>)
The header has a crit member; this crate understands no extensions, so it must reject
every one of them (RFC 7515 §4.1.11).
UnencodedPayload
The header sets b64 to false (RFC 7797); only base64url-encoded payloads are supported.
InvalidPayload
The payload cannot be signed as given (a claims set that holds a registered claim under
additional next to its field, say), or is not the JSON
CompactJws::claims was asked to read it as.
The source is the JSON error, when there is one.
AlgorithmMismatch
The header alg differs from the algorithm of the signer.
Signer(SignError)
The signer failed.
Trait Implementations§
Source§impl Error for JwsError
impl Error for JwsError
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<JwsError> for JwtValidationError
impl From<JwsError> for JwtValidationError
Source§impl From<JwsError> for SdJwtError
Available on crate feature sd-jwt only.
impl From<JwsError> for SdJwtError
sd-jwt only.Source§impl From<JwsError> for StatusListError
Available on crate feature status-list only.
impl From<JwsError> for StatusListError
status-list only.