use thiserror::Error;
#[derive(Debug, Error)]
pub enum CryptoError {
#[error("JCS does not support Infinity or NaN")]
JcsInvalidNumber,
#[error("Cannot canonicalize type")]
JcsUnsupportedType,
#[error("Invalid UUID: {0}")]
InvalidUuid(String),
#[error("Salt must be 16 bytes")]
InvalidSalt,
#[error("At least one recipient required")]
NoRecipients,
#[error("Recipient {0} not found")]
RecipientNotFound(u32),
#[error("Payload hash mismatch")]
PayloadHashMismatch,
#[error("Signature verification failed: {0}")]
SignatureError(String),
#[error("Encryption error: {0}")]
EncryptionError(String),
#[error("Decryption error: {0}")]
DecryptionError(String),
#[error("Key wrapping error: {0}")]
KeyWrapError(String),
#[error("Serialization error: {0}")]
SerializationError(String),
}