pub struct AcmeManager {
pub acme_email: String,
pub cache_dir: PathBuf,
/* private fields */
}Expand description
Manages ACME HTTP-01 challenges and certificate loading.
Fields§
§acme_email: String§cache_dir: PathBufImplementations§
Source§impl AcmeManager
impl AcmeManager
pub fn new(email: impl Into<String>, cache_dir: impl Into<PathBuf>) -> Self
Sourcepub fn with_default_cache(email: impl Into<String>) -> Self
pub fn with_default_cache(email: impl Into<String>) -> Self
Create a manager with default cache directory (~/.orca/certs/).
Sourcepub async fn add_domain(&self, domain: impl Into<String>)
pub async fn add_domain(&self, domain: impl Into<String>)
Register a domain for certificate provisioning.
Sourcepub async fn set_challenge(&self, token: String, authorization: String)
pub async fn set_challenge(&self, token: String, authorization: String)
Store a challenge token and its authorization response.
Sourcepub async fn get_challenge_response(&self, token: &str) -> Option<String>
pub async fn get_challenge_response(&self, token: &str) -> Option<String>
Get the authorization response for an HTTP-01 challenge token.
Sourcepub async fn clear_challenge(&self, token: &str)
pub async fn clear_challenge(&self, token: &str)
Remove a completed challenge.
Sourcepub fn load_cached_certs(
&self,
domain: &str,
) -> Option<(Vec<CertificateDer<'static>>, PrivateKeyDer<'static>)>
pub fn load_cached_certs( &self, domain: &str, ) -> Option<(Vec<CertificateDer<'static>>, PrivateKeyDer<'static>)>
Load certificates from cache. Returns None if missing or unparseable.
Sourcepub fn needs_renewal(&self, domain: &str) -> bool
pub fn needs_renewal(&self, domain: &str) -> bool
Returns true if certs are missing or expiring within 30 days.
Sourcepub fn tls_acceptor_for(&self, domain: &str) -> Result<Option<TlsAcceptor>>
pub fn tls_acceptor_for(&self, domain: &str) -> Result<Option<TlsAcceptor>>
Build a TlsAcceptor from cached certs for the given domain.
Sourcepub async fn ensure_cert_for_resolver(
&self,
domain: &str,
resolver: &DynCertResolver,
) -> Result<()>
pub async fn ensure_cert_for_resolver( &self, domain: &str, resolver: &DynCertResolver, ) -> Result<()>
Provision a cert for a domain and add it to the dynamic resolver.
If a valid cached cert exists, it’s loaded instead of re-provisioning.
This is the hot-provisioning entry point called during orca deploy.
pub fn cert_path(&self, domain: &str) -> PathBuf
pub fn key_path(&self, domain: &str) -> PathBuf
pub async fn domains(&self) -> Vec<String>
Sourcepub fn provider(&self) -> AcmeProvider
pub fn provider(&self) -> AcmeProvider
Build an AcmeProvider from this manager for cert provisioning.
Trait Implementations§
Source§impl Clone for AcmeManager
impl Clone for AcmeManager
Source§fn clone(&self) -> AcmeManager
fn clone(&self) -> AcmeManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more