yacme
Yet Another ACME Client
This crate provides the unified interface to using YACME sub-crates.
To get started, check out yacme::service, which provides
a high level, strongly typed interface to an ACME client.
An example is available in letsencrypt-pebble.rs
Getting Started
Using the high level service interface, you can connect to letsencrypt (or really, and ACME provider) and issue a certificate:
(check out letsencrypt-pebble.rs for more details on this example)
let provider = build.
directory_url
.build
.await?;
let account_key = new;
// Fetch an existing account
let account = provider.account.key.must_exist.get.await?;
// Create a new order
let mut order = account
.order
.dns
.dns
.create
.await?;
// Get the authorizations
let authz: = order.authorizations.await?;
let auth = authz.first.unwrap;
let chall = auth
.challenge
.ok_or?;
let inner = chall.http01.unwrap;
// Complete the challenges, then call
chall.ready.await?;
// Wait for the service to acknowleged the challenge
auth.finalize.await?;
// Set a certifiacte key
let cert_key = new;
// Attach the certificate key to the order
order.certificate_key;
// Finalize and fetch the order
let cert = order.finalize_and_donwload.await?;
License
MIT