Skip to main content

affinidi_crypto/
error.rs

1//! Error types for cryptographic operations
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum CryptoError {
7    #[error("Key error: {0}")]
8    KeyError(String),
9
10    #[error("Decoding error: {0}")]
11    Decoding(String),
12
13    #[error("Unsupported key type: {0}")]
14    UnsupportedKeyType(String),
15
16    #[error("Encoding error: {0}")]
17    Encoding(#[from] affinidi_encoding::EncodingError),
18}
19
20pub type Result<T> = std::result::Result<T, CryptoError>;