1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum Error {
6 #[error("Unable to handle the URL as the format was invalid: {0}")]
8 UrlEncodingError(#[from] std::string::FromUtf8Error),
9 #[error("Version {0} is not supported")]
11 UnsupportedVersion(u8),
12 #[error("Unable to parse RSA private key: {0}")]
14 PrivateKeyDecodeError(#[from] rsa::pkcs1::Error),
15 #[error("Unable to parse RSA public key: {0}")]
17 PublicKeyDecodeError(#[from] spki::Error),
18 #[error("RSA algorithm error: {0}")]
20 RsaSignError(#[from] rsa::Error),
21 #[error("Unable to verify RSA signature: {0}")]
23 SignatureVerifyError(#[from] rsa::signature::Error),
24 #[error("Unable to decode base64-encoded signature: {0}")]
26 SignatureDecodeError(#[from] base64::DecodeError),
27}