1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use thiserror::Error;

#[derive(Error, Debug)]
pub enum JoseError {
    #[error("Unsupported signature algorithm: {0}")]
    UnsupportedSignatureAlgorithm(#[source] anyhow::Error),

    #[error("Invalid JWT format: {0}")]
    InvalidJwtFormat(#[source] anyhow::Error),

    #[error("Invalid JWK format: {0}")]
    InvalidJwkFormat(#[source] anyhow::Error),

    #[error("Invalid JWS format: {0}")]
    InvalidJwsFormat(#[source] anyhow::Error),

    #[error("Invalid JWE format: {0}")]
    InvalidJweFormat(#[source] anyhow::Error),

    #[error("Invalid key format: {0}")]
    InvalidKeyFormat(#[source] anyhow::Error),

    #[error("Invalid json: {0}")]
    InvalidJson(#[source] anyhow::Error),

    #[error("Invalid claim: {0}")]
    InvalidClaim(#[source] anyhow::Error),

    #[error("Invalid signature: {0}")]
    InvalidSignature(#[source] anyhow::Error),
}