easy-rsa-registry

Crates.ioeasy-rsa-registry
lib.rseasy-rsa-registry
version0.3.0
sourcesrc
created_at2023-09-22 22:25:52.331757
updated_at2023-10-10 15:01:21.914831
descriptionRead certificate data from easy-rsa registry
homepagehttps://gitlab.com/weird-crates/easy-rsa-registry-rs.git
repositoryhttps://gitlab.com/weird-crates/easy-rsa-registry-rs.git
max_upload_size
id980899
size20,261
Eugene Lebedev (lebe-dev)

documentation

README

easy-rsa registry

Getting started

cargo add easy-rsa-registry

Functions

Read certs from registry file

let registry_file_path = Path::new("index.txt");
let registry_file_path = format!("{}", registry_file_path.display());
let certs = read_certs_from_file(&registry_file_path)?;

Update cert status

let registry_file_path = Path::new("index.txt");
let registry_file_path = format!("{}", registry_file_path.display());
let cert_serial: &str = "36593F7437AEB5007D2953E7A98B7601";
let certs = update_cert_status(&registry_file_path, &cert_serial, EasyRsaCertificateStatus::Revoked)?;

Remove certificate by serial

let registry_file_path = Path::new("index.txt");
let registry_file_path = format!("{}", registry_file_path.display());
let cert_serial: &str = "36593F7437AEB5007D2953E7A98B7601";
let certs = remove_cert(&registry_file_path, &cert_serial)?;
Commit count: 11

cargo fmt