acme-api: implement revoke certificate helper

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer 2024-06-06 10:23:35 +02:00
parent 53ff71772f
commit 04505ada7a
2 changed files with 11 additions and 1 deletions

View File

@ -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<u8>,
pub private_key_pem: Vec<u8>,

View File

@ -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};