agent-id-core 0.1.0

Core identity primitives for the Agent Identity Protocol
Documentation
//! Error types for agent-id-core.

use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
    #[error("Invalid DID format: {0}")]
    InvalidDid(String),

    #[error("Invalid signature")]
    InvalidSignature,

    #[error("Key generation failed: {0}")]
    KeyGeneration(String),

    #[error("Serialization error: {0}")]
    Serialization(#[from] serde_json::Error),

    #[error("Invalid base58 encoding: {0}")]
    Base58(String),

    #[error("Delegation expired")]
    DelegationExpired,

    #[error("Delegation not yet valid")]
    DelegationNotYetValid,

    #[error("Invalid delegation chain")]
    InvalidDelegationChain,

    #[error("Validation error: {0}")]
    Validation(String),

    #[error("Key revoked")]
    KeyRevoked,

    #[error("Recovery pending")]
    RecoveryPending,

    #[error("Recovery cancelled")]
    RecoveryCancelled,
}