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.
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AcmeManager
impl !RefUnwindSafe for AcmeManager
impl Send for AcmeManager
impl Sync for AcmeManager
impl Unpin for AcmeManager
impl UnsafeUnpin for AcmeManager
impl !UnwindSafe for AcmeManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more