use std::error::Error;
use strum_macros::{Display, EnumString};

#[repr(u8)]
#[derive(Debug, Display, EnumString, Clone, Copy, Eq, PartialEq)]
pub enum DatError{
    // signature
    UnknownDatSignatureAlgorithm,
    ParseDatSigningKeyError,
    ParseDatVerifyingKeyError,

    // crypto
    UnknownCryptoAlgorithm,
    ParseCryptoKeyError,
    EncryptError,
    DecryptError,

    // DatKey
    UnSupportDatKeyVersion,
    InvalidDatKeyFormat,
    VerifyOnlyKey,
    SigningKeyNotExists,
    KidNotFound,

    // Dat
    InvalidDat,
    InvalidDatKidFormat,

    // etc
    InvalidBase64Format,
    Utf8EncodeError,
    IoError,
}

impl Error for DatError {}
