use std::path::{Path, PathBuf};
#[derive(Clone, Debug)]
pub enum Timestamp {
Authenticode(String),
Rfc3161(String),
Authority {
certificates: PathBuf,
key: PathBuf,
unix_time: Option<i64>,
},
}
impl Timestamp {
pub fn authenticode(url: impl Into<String>) -> Self {
Self::Authenticode(url.into())
}
pub fn rfc3161(url: impl Into<String>) -> Self {
Self::Rfc3161(url.into())
}
pub fn authority(
certificates: impl AsRef<Path>,
key: impl AsRef<Path>,
unix_time: Option<i64>,
) -> Self {
Self::Authority {
certificates: certificates.as_ref().to_path_buf(),
key: key.as_ref().to_path_buf(),
unix_time,
}
}
}
#[derive(Clone, Debug)]
pub struct Network {
pub proxy: Option<String>,
pub verify_peer: bool,
pub https_ca: Option<PathBuf>,
pub https_crl: Option<PathBuf>,
}
impl Default for Network {
fn default() -> Self {
Self {
proxy: None,
verify_peer: true,
https_ca: None,
https_crl: None,
}
}
}
#[derive(Clone, Debug, Default)]
pub struct TrustAnchors {
pub ca_file: Option<PathBuf>,
pub crl_file: Option<PathBuf>,
pub tsa_ca: Option<PathBuf>,
pub tsa_crl: Option<PathBuf>,
}