#[non_exhaustive]pub enum JwsError {
InvalidFormat {
parts: usize,
},
InvalidBase64Url {
part: &'static str,
},
InvalidHeader(String),
UnsupportedAlgorithm(String),
UnsupportedCritical(Vec<String>),
UnencodedPayload,
InvalidPayload(String),
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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidFormat
The input is not three base64url parts separated by ..
InvalidBase64Url
A part is not valid base64url without padding.
InvalidHeader(String)
The protected header is not a JSON object with the expected members.
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(String)
The payload cannot be signed as given: a claims set that holds a registered claim under
additional next to its field, say.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<JwsError> for SdJwtError
Available on crate feature sd-jwt only.
impl From<JwsError> for SdJwtError
Available on crate feature
sd-jwt only.Source§impl From<JwsError> for StatusListError
Available on crate feature sd-jwt only.
impl From<JwsError> for StatusListError
Available on crate feature
sd-jwt only.Auto Trait Implementations§
impl !RefUnwindSafe for JwsError
impl !UnwindSafe for JwsError
impl Freeze for JwsError
impl Send for JwsError
impl Sync for JwsError
impl Unpin for JwsError
impl UnsafeUnpin for JwsError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more