1pub type Result<T, E = Error> = core::result::Result<T, E>;
8
9#[derive(Debug, thiserror::Error)]
11#[non_exhaustive]
12pub enum Error {
13 #[error("invalid json")]
15 InvalidJson(#[source] serde_json::Error),
16 #[error("invalid base64")]
18 InvalidBase64(#[source] identity_core::error::Error),
19 #[error("invalid utf-8")]
21 InvalidUtf8(#[source] core::str::Utf8Error),
22 #[error("invalid claim `{0}`")]
24 InvalidClaim(&'static str),
25 #[error("missing claim `{0}`")]
27 MissingClaim(&'static str),
28 #[error("invalid param: {0}")]
30 InvalidParam(&'static str),
31 #[error("missing param `{0}`")]
33 MissingParam(&'static str),
34 #[error("{0}")]
36 InvalidContent(&'static str),
37 #[error("invalid key format for type `{0}`")]
39 KeyError(&'static str),
40 #[error("attempt to parse an unregistered jws algorithm")]
42 JwsAlgorithmParsingError,
43 #[error("signature verification error; {0}")]
45 SignatureVerificationError(#[source] crate::jws::SignatureVerificationError),
46 #[error("missing header")]
48 MissingHeader(&'static str),
49 #[error("missing alg in protected header")]
51 ProtectedHeaderWithoutAlg,
52 #[error("failed to convert key: `{0}`")]
54 KeyConversion(String),
55 #[error("key type not supported; {0}")]
57 UnsupportedKeyType(String),
58}