use hex::FromHexError;
use std::string::FromUtf8Error;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum Sm2Error {
    #[error("LibSmError: {0}")]
    LibSmError(String),
    #[error("HexError: {0}")]
    HexError(#[from] FromHexError),
    #[error("FromUtf8Error: {0}")]
    FromUtf8Error(#[from] FromUtf8Error),
    #[error("DecodeError: {0}")]
    DecodeError(#[from]  base64::DecodeError),
    #[error("OpensslError: {0}")]
    OpensslError(#[from] openssl::error::ErrorStack),
}