use crate::errors::TeeError;
#[derive(Debug, thiserror::Error)]
pub enum AttestationError {
#[error("attestation fetch failed for {provider}: {reason}")]
Fetch { provider: String, reason: String },
#[error("attestation signature verification failed for {provider}: {reason}")]
Signature { provider: String, reason: String },
#[error("attestation claim rejected for {provider}: {reason}")]
Claim { provider: String, reason: String },
#[error("could not obtain signing keys for {provider}: {reason}")]
Keys { provider: String, reason: String },
#[error("require_tee unsatisfiable for {provider}: {reason}")]
Unsatisfiable { provider: String, reason: String },
#[error("malformed attestation for {provider}: {reason}")]
Malformed { provider: String, reason: String },
}
impl From<AttestationError> for TeeError {
fn from(err: AttestationError) -> Self {
Self::AttestationVerification(err.to_string())
}
}