use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("PDF parsing/serialization error: {0}")]
Pdf(#[from] lopdf::Error),
#[error("cryptography error: {0}")]
Crypto(String),
#[error("signature does not fit in reserved placeholder: need {needed} bytes, have {capacity}")]
PlaceholderTooSmall { needed: usize, capacity: usize },
#[error("malformed PDF: {0}")]
Malformed(String),
#[error("signature verification failed: {0}")]
Verification(String),
}