6 releases

0.3.0 Oct 10, 2023
0.2.3 Oct 4, 2023
0.2.1 Sep 26, 2023
0.1.0 Sep 22, 2023

#2565 in Parser implementations

MIT/Apache

17KB
326 lines

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)?;

Dependencies

~1.2–2MB
~36K SLoC