use thiserror::Error;
#[derive(Error, Debug)]
pub enum SignError {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Base64 decode error: {0}")]
Base64(#[from] base64::DecodeError),
#[error("Signature error: {0}")]
Signature(#[from] ed25519_dalek::SignatureError),
#[error("Invalid key: {0}")]
InvalidKey(String),
#[error("Verification failed: {0}")]
VerificationFailed(String),
#[error("Hash mismatch: expected {expected}, got {actual}")]
HashMismatch { expected: String, actual: String },
#[error("No signatures found in document")]
NoSignatures,
#[error("Invalid signature format: {0}")]
InvalidFormat(String),
}
pub type Result<T> = std::result::Result<T, SignError>;