use thiserror::Error;
use crate::crypto_helper::{KesEvolutions, KesPeriod};
#[derive(Error, Debug)]
pub enum KesVerifyError {
#[error("invalid operational certificate")]
OpCertInvalid,
#[error("KES signature verification error: KesEvolutions={0}, StartKesPeriod={1}")]
SignatureInvalid(KesEvolutions, KesPeriod),
#[error("invalid KES evolutions")]
InvalidKesEvolutions(KesEvolutions),
}
#[derive(Error, Debug, PartialEq, Eq)]
pub enum KesSignError {
#[error("KES key cannot be updated for evolution {0}")]
UpdateKey(KesEvolutions),
#[error("Period of key file {0} does not match with period provided by user {1}")]
PeriodMismatch(KesPeriod, KesPeriod),
}