Skip to main content

wire_e2e_identity/acme/
error.rs

1/// Wrapper over a [Result] with an ACME error
2pub(crate) type Result<T> = core::result::Result<T, Error>;
3
4/// All errors which the `acme` module might throw
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7    /// Invalid Json representation
8    #[error(transparent)]
9    Json(#[from] serde_json::Error),
10    /// Error while building a JWT
11    #[error(transparent)]
12    Jwt(#[from] rusty_jwt_tools::prelude::RustyJwtError),
13    /// x509-cert builder error
14    #[error(transparent)]
15    X509CertBuilder(#[from] x509_cert::builder::Error),
16    /// Failed mapping an ASN.1 ObjectIdentifier
17    #[error(transparent)]
18    Oid(#[from] x509_cert::der::oid::Error),
19    /// Failed mapping a DER certificate
20    #[error(transparent)]
21    Der(#[from] x509_cert::der::Error),
22    /// Error while parsing a PEM document
23    #[error(transparent)]
24    Pem(#[from] pem::PemError),
25    /// Pkcs8 error
26    #[error(transparent)]
27    Pkcs8(#[from] ed25519_dalek::pkcs8::Error),
28    /// Error while handling a JWS or JWK
29    #[error(transparent)]
30    JsonWebToken(#[from] rusty_jwt_tools::jsonwebtoken::errors::Error),
31    /// Error with hand-rolled signature
32    #[error(transparent)]
33    Signature(#[from] signature::Error),
34    /// We have done something terribly wrong
35    #[error("We have done something terribly wrong and it needs to be fixed")]
36    Implementation,
37    /// This library has been used the wrong way by users
38    #[error("This library has been used the wrong way by users because {0}")]
39    ClientImplementation(&'static str),
40    /// Smallstep ACME server is not correctly implemented
41    #[error("Incorrect response from ACME server because {0}")]
42    SmallstepImplementation(&'static str),
43    /// Error while processing an account
44    #[error(transparent)]
45    Account(#[from] crate::acme::account::AcmeAccountError),
46    /// Error while processing an order
47    #[error(transparent)]
48    Order(#[from] crate::acme::order::AcmeOrderError),
49    /// Error while processing an authorization
50    #[error(transparent)]
51    Authz(#[from] crate::acme::authz::AcmeAuthzError),
52    /// Error while validating a challenge
53    #[error(transparent)]
54    Challenge(#[from] crate::acme::chall::AcmeChallError),
55    /// Error while finalizing an order
56    #[error(transparent)]
57    Finalize(#[from] crate::acme::finalize::AcmeFinalizeError),
58    /// UTF-8 parsing error
59    #[error(transparent)]
60    Utf8(#[from] std::str::Utf8Error),
61}