wire_e2e_identity/acme/
error.rs1pub type RustyAcmeResult<T> = Result<T, RustyAcmeError>;
3
4#[derive(Debug, thiserror::Error)]
6pub enum RustyAcmeError {
7 #[error(transparent)]
9 JsonError(#[from] serde_json::Error),
10 #[error(transparent)]
12 UrlError(#[from] url::ParseError),
13 #[error(transparent)]
15 JwtError(#[from] rusty_jwt_tools::prelude::RustyJwtError),
16 #[error(transparent)]
18 X509CheckError(#[from] crate::acme::x509_check::RustyX509CheckError),
19 #[error(transparent)]
21 OidError(#[from] x509_cert::der::oid::Error),
22 #[error(transparent)]
24 DerError(#[from] x509_cert::der::Error),
25 #[error(transparent)]
27 PemError(#[from] pem::PemError),
28 #[error(transparent)]
30 RawJwtError(#[from] jwt_simple::Error),
31 #[error(transparent)]
33 SignatureError(#[from] signature::Error),
34 #[error("We have done something terribly wrong and it needs to be fixed")]
36 ImplementationError,
37 #[error("Requested functionality is not supported for the moment")]
39 NotSupported,
40 #[error("This library has been used the wrong way by users because {0}")]
42 ClientImplementationError(&'static str),
43 #[error("Incorrect response from ACME server because {0}")]
45 SmallstepImplementationError(&'static str),
46 #[error(transparent)]
48 AccountError(#[from] crate::acme::account::AcmeAccountError),
49 #[error(transparent)]
51 OrderError(#[from] crate::acme::order::AcmeOrderError),
52 #[error(transparent)]
54 AuthzError(#[from] crate::acme::authz::AcmeAuthzError),
55 #[error(transparent)]
57 ChallengeError(#[from] crate::acme::chall::AcmeChallError),
58 #[error(transparent)]
60 FinalizeError(#[from] crate::acme::finalize::AcmeFinalizeError),
61 #[error(transparent)]
63 Utf8(#[from] std::str::Utf8Error),
64 #[error(transparent)]
66 InvalidCertificate(#[from] CertificateError),
67}
68
69#[derive(Debug, thiserror::Error)]
71pub enum CertificateError {
72 #[error("ClientId does not match expected one")]
74 ClientIdMismatch,
75 #[error("Display name does not match expected one")]
77 DisplayNameMismatch,
78 #[error("Handle does not match expected one")]
80 HandleMismatch,
81 #[error("Domain does not match expected one")]
83 DomainMismatch,
84 #[error("DisplayName is missing from the certificate")]
86 MissingDisplayName,
87 #[error("Handle is missing from the certificate")]
89 MissingHandle,
90 #[error("Domain is missing from the certificate")]
92 MissingDomain,
93 #[error("ClientId is missing from the certificate")]
95 MissingClientId,
96 #[error("X509 lacks required standard fields")]
98 InvalidFormat,
99 #[error("Advertised public key does not match algorithm")]
101 InvalidPublicKey,
102 #[error("Advertised public key is not supported")]
104 UnsupportedPublicKey,
105}