CertRecord and the Index
#[derive(Serialize, Deserialize)]
pub struct CertRecord {
pub serial: String,
pub subject: String,
pub cert_type: CertType,
pub not_before: String,
pub not_after: String,
pub pem_path: PathBuf,
pub revoked_at: Option<String>,
pub revoke_reason: Option<String>,
}
#[derive(Serialize, Deserialize)]
pub struct CertStore {
pub records: Vec<CertRecord>,
}
impl CertStore {
pub fn load(path: &Path) -> anyhow::Result<Self>;
pub fn save(&self, path: &Path) -> anyhow::Result<()>;
pub fn find_by_serial(&self, serial: &str) -> Option<&CertRecord>;
pub fn add(&mut self, record: CertRecord);
}