pub struct AcmeClient { /* private fields */ }Expand description
ACME protocol client for automated certificate management.
Implementations§
Source§impl AcmeClient
impl AcmeClient
Sourcepub async fn new(config: AcmeConfig) -> Result<Self>
pub async fn new(config: AcmeConfig) -> Result<Self>
Create a new ACME client and fetch the directory.
Sourcepub fn from_parts(
config: AcmeConfig,
key_pair: EcdsaKeyPair,
directory: AcmeDirectory,
) -> Self
pub fn from_parts( config: AcmeConfig, key_pair: EcdsaKeyPair, directory: AcmeDirectory, ) -> Self
Create an ACME client from an existing key pair and directory (for testing).
Sourcepub fn directory(&self) -> &AcmeDirectory
pub fn directory(&self) -> &AcmeDirectory
Get the ACME directory resource.
Sourcepub async fn register_account(&self) -> Result<AcmeAccount>
pub async fn register_account(&self) -> Result<AcmeAccount>
Register a new ACME account (RFC 8555 §7.3).
Sourcepub async fn create_order(&self, domains: &[&str]) -> Result<AcmeOrder>
pub async fn create_order(&self, domains: &[&str]) -> Result<AcmeOrder>
Create a new certificate order (RFC 8555 §7.4).
Fetch an authorization resource (RFC 8555 §7.5).
Compute the key authorization string for a challenge (RFC 8555 §8.1).
key_authorization = token || '.' || base64url(JWK_Thumbprint)
Sourcepub fn dns01_record_value(&self, token: &str) -> String
pub fn dns01_record_value(&self, token: &str) -> String
Compute the DNS-01 challenge record value (RFC 8555 §8.4).
Returns the base64url-encoded SHA-256 of the key authorization.
Sourcepub async fn respond_to_challenge(
&self,
challenge_url: &str,
) -> Result<AcmeChallenge>
pub async fn respond_to_challenge( &self, challenge_url: &str, ) -> Result<AcmeChallenge>
Respond to a challenge to begin validation (RFC 8555 §7.5.1).
Sourcepub async fn finalize_order(
&self,
finalize_url: &str,
csr_der: &[u8],
) -> Result<AcmeOrder>
pub async fn finalize_order( &self, finalize_url: &str, csr_der: &[u8], ) -> Result<AcmeOrder>
Finalize an order by submitting a CSR (RFC 8555 §7.4).
Sourcepub async fn download_certificate(&self, cert_url: &str) -> Result<String>
pub async fn download_certificate(&self, cert_url: &str) -> Result<String>
Download the issued certificate chain (RFC 8555 §7.4.2).
Sourcepub fn account_thumbprint(&self) -> String
pub fn account_thumbprint(&self) -> String
Get the JWK thumbprint of the account key.
Auto Trait Implementations§
impl Freeze for AcmeClient
impl !RefUnwindSafe for AcmeClient
impl Send for AcmeClient
impl Sync for AcmeClient
impl Unpin for AcmeClient
impl UnsafeUnpin for AcmeClient
impl !UnwindSafe for AcmeClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more