quickcert 0.1.2

For generating test key/certificate pairs
Documentation
use std::{fmt, io};

#[derive(Debug)]
pub enum Error {
  OpenSSL(openssl::error::ErrorStack),
  IO(io::Error)
}

impl std::error::Error for Error {}

impl fmt::Display for Error {
  fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
    match self {
      Self::IO(e) => write!(f, "I/O error; {e}"),
      Self::OpenSSL(e) => write!(f, "OpenSSL error; {e}")
    }
  }
}

impl From<io::Error> for Error {
  fn from(err: io::Error) -> Self {
    Self::IO(err)
  }
}

impl From<openssl::error::ErrorStack> for Error {
  fn from(err: openssl::error::ErrorStack) -> Self {
    Self::OpenSSL(err)
  }
}

// vim: set ft=rust et sw=2 ts=2 sts=2 cinoptions=2 tw=79 :