| Crates.io | acme-types |
| lib.rs | acme-types |
| version | 0.1.1 |
| created_at | 2022-01-16 11:46:51.911732+00 |
| updated_at | 2022-01-16 13:27:03.881518+00 |
| description | Types for implementing ACME (RFC 8555) providers and clients |
| homepage | https://git.doom.fm/citruspi/acme-types-rs |
| repository | https://git.doom.fm/citruspi/acme-types-rs |
| max_upload_size | |
| id | 514782 |
| size | 40,537 |
This crate defines types for implementing ACME (RFC 8555) providers and clients.
use acme_types::v2 as ACME;
let resp = reqwest::get("https://acme-v02.api.letsencrypt.org/directory")
.await?
.text()
.await?;
let directory = ACME::Directory::from_str(&resp).unwrap();
println!("{:#?}", directory);
>>> Directory {
>>> new_nonce: "https://acme-v02.api.letsencrypt.org/acme/new-nonce",
>>> new_account: "https://acme-v02.api.letsencrypt.org/acme/new-acct",
>>> new_order: "https://acme-v02.api.letsencrypt.org/acme/new-order",
>>> new_authorization: None,
>>> revoke_certificate: "https://acme-v02.api.letsencrypt.org/acme/revoke-cert",
>>> key_change: "https://acme-v02.api.letsencrypt.org/acme/key-change",
>>> metadata: Some(
>>> DirectoryMetadata {
>>> terms_of_service: Some(
>>> "https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf",
>>> ),
>>> website: Some(
>>> "https://letsencrypt.org",
>>> ),
>>> caa_identities: Some(
>>> [
>>> "letsencrypt.org",
>>> ],
>>> ),
>>> external_account_required: None,
>>> },
>>> ),
>>> }
json)Serialization and deserialization to and from JSON is supported using the serde (and serde_json) crate(s). This integration is optional (feature json):
acme-types = { version = "*", features = ["json"] }
When this feature is enabled, from_str and to_string are implemented on top-level ACME objects and resources.