1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum TrustError {
5 #[error("signature verification failed")]
6 InvalidSignature,
7 #[error("invalid key encoding")]
8 InvalidKey,
9 #[error("certificate not found: {name}")]
10 CertNotFound { name: String },
11 #[error("certificate chain too deep (limit: {limit})")]
12 ChainTooDeep { limit: usize },
13 #[error("certificate chain cycle detected at: {name}")]
14 ChainCycle { name: String },
15 #[error("name does not match trust schema")]
16 SchemaMismatch,
17 #[error("key store error: {0}")]
18 KeyStore(String),
19}