diff --git a/proxmox-acme-api/src/certificate_helpers.rs b/proxmox-acme-api/src/certificate_helpers.rs index c83f2d57..8f8b28f9 100644 --- a/proxmox-acme-api/src/certificate_helpers.rs +++ b/proxmox-acme-api/src/certificate_helpers.rs @@ -9,6 +9,16 @@ use proxmox_sys::{task_log, task_warn}; use crate::types::{AcmeConfig, AcmeDomain}; +pub async fn revoke_certificate(acme_config: AcmeConfig, certificate: &[u8]) -> Result<(), Error> { + let mut acme = super::account_config::load_account_config(&acme_config.account) + .await? + .client(); + + acme.revoke_certificate(certificate, None).await?; + + Ok(()) +} + pub struct OrderedCertificate { pub certificate: Vec, pub private_key_pem: Vec, diff --git a/proxmox-acme-api/src/lib.rs b/proxmox-acme-api/src/lib.rs index 3230f8cf..9990717c 100644 --- a/proxmox-acme-api/src/lib.rs +++ b/proxmox-acme-api/src/lib.rs @@ -43,4 +43,4 @@ pub(crate) mod acme_plugin; #[cfg(feature = "impl")] mod certificate_helpers; #[cfg(feature = "impl")] -pub use certificate_helpers::order_certificate; +pub use certificate_helpers::{order_certificate, revoke_certificate};