### Rust Standard Library and Tools Source: https://docs.rs/instant-acme/latest/instant_acme/index Provides links to essential Rust documentation, including the standard library API reference, The Book, Rust by Example, and the Cargo Guide. ```Rust Rust Resources: Rust website: https://www.rust-lang.org/ The Book: https://doc.rust-lang.org/book/ Standard Library API Reference: https://doc.rust-lang.org/std/ Rust by Example: https://doc.rust-lang.org/rust-by-example/ The Cargo Guide: https://doc.rust-lang.org/cargo/guide/ Clippy Documentation: https://doc.rust-lang.org/nightly/clippy ``` -------------------------------- ### Help Documentation Source: https://docs.rs/instant-acme/latest/index Offers assistance and guidance on using the instant_acme crate. This link directs to helpful resources and usage examples. ```rust https://docs.rs/instant-acme/latest/help.html ``` -------------------------------- ### AuthorizationHandle Methods Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Provides methods for interacting with an ACME authorization. Includes retrieving a challenge handle for a specific type and getting the authorization URL. ```rust /// Get a [`ChallengeHandle`] for the given `type` /// /// Yields an object to interact with the challenge for the given type, if available. pub fn challenge(&'a mut self, r#type: ChallengeType) -> Option> { let challenge = self.state.challenges.iter().find(|c| c.r#type == r#type)?; Some(ChallengeHandle { identifier: self.state.identifier(), challenge, nonce: self.nonce, account: self.account, }) } /// Get the URL of the authorization pub fn url(&self) -> &str { self.url } ``` -------------------------------- ### Rust AuthorizationState Methods Source: https://docs.rs/instant-acme/latest/src/instant_acme/types Provides methods for interacting with the `AuthorizationState`. Currently, it includes a method to get an `AuthorizedIdentifier` based on the authorization's details. ```rust impl AuthorizationState { /// Creates an [`AuthorizedIdentifier`] for the identifier in this authorization pub fn identifier(&self) -> AuthorizedIdentifier<'_> { self.identifier.authorized(self.wildcard) } } ``` -------------------------------- ### Instant Acme Client Initialization Source: https://docs.rs/instant-acme/latest/src/instant_acme/lib Demonstrates how to create a new `Client` instance for the Instant Acme library. This involves providing a directory URL and an HTTP client implementation. The client fetches and parses the ACME directory upon initialization. ```rust use instant_acme::Client; use instant_acme::HttpClient; use std::boxed::Box; async fn create_client(directory_url: String, http_client: Box) -> Result { Client::new(directory_url, http_client).await } ``` -------------------------------- ### Get Order State Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Returns a reference to the last known state of the order. To get the most recent state from the server, call the `refresh()` method first. ```rust pub fn state(&mut self) -> &OrderState { &self.state } ``` -------------------------------- ### ACME Problem Structure Example Source: https://docs.rs/instant-acme/latest/src/instant_acme/types Demonstrates the structure of an ACME Problem object, including its type, detail message, and a list of subproblems. This example shows how to deserialize a JSON string into the `Problem` struct and assert its contents. ```rust let problem_json = r#"{ "type": "urn:ietf:params:acme:error:malformed", "detail": "Some of the identifiers requested were rejected", "subproblems": [ { "type": "urn:ietf:params:acme:error:malformed", "detail": "Invalid underscore in DNS name \"_example.org\"", "identifier": { "type": "dns", "value": "_example.org" } }, { "type": "urn:ietf:params:acme:error:rejectedIdentifier", "detail": "This CA will not issue for \"example.net\"", "identifier": { "type": "dns", "value": "example.net" } } ] }"#; let obj = serde_json::from_str::(problem_json).unwrap(); assert_eq!(obj.r#type, Some("urn:ietf:params:acme:error:malformed".into())); assert_eq!(obj.detail, Some("Some of the identifiers requested were rejected".into())); let subproblems = &obj.subproblems; assert_eq!(subproblems.len(), 2); let first_subproblem = subproblems.first().unwrap(); assert_eq!(first_subproblem.identifier, Some(Identifier::Dns("_example.org".into()))); assert_eq!(first_subproblem.r#type, Some("urn:ietf:params:acme:error:malformed".into())); assert_eq!(first_subproblem.detail, Some(r#"Invalid underscore in DNS name "_example.org""#.into())); let second_subproblem = subproblems.get(1).unwrap(); assert_eq!(second_subproblem.identifier, Some(Identifier::Dns("example.net".into()))); ``` -------------------------------- ### Account Creation from Credentials Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Asynchronously creates an AccountInner instance from provided AccountCredentials. It handles key parsing (expecting PKCS#8 format) and client initialization based on directory information or explicit URLs. ```rust async fn from_credentials( credentials: AccountCredentials, http: Box, ) -> Result { Ok(Self { id: credentials.id, key: match credentials.key_pkcs8 { PrivateKeyDer::Pkcs8(inner) => Key::from_pkcs8_der(inner)?, _ => return Err("unsupported key format, expected PKCS#8".into()), }, client: Arc::new(match (credentials.directory, credentials.urls) { (Some(directory_url), _) => Client::new(directory_url, http).await?, (None, Some(directory)) => Client { http, directory, directory_url: None, }, (None, None) => return Err("no server URLs found".into()) }), }) } ``` -------------------------------- ### Get Order URL Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Returns a reference to the URL of the order. This is the endpoint used to interact with the order on the ACME server. ```rust pub fn url(&self) -> &str { &self.url } ``` -------------------------------- ### Settings Documentation Source: https://docs.rs/instant-acme/latest/index Provides access to the settings configuration for the instant_acme crate. This link leads to detailed documentation on how to configure the ACME client. ```rust https://docs.rs/instant-acme/latest/settings.html ``` -------------------------------- ### instant-acme Development Dependencies Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Lists the development dependencies used for testing and building the instant-acme crate. These include tools like anyhow, clap, tempfile, and tracing. ```Rust anyhow ^1.0.66 clap ^4.0.29 rustls ^0.23 tempfile ^3 tokio ^1.22.0 tracing ^0.1.37 tracing-subscriber ^0.3.16 ``` -------------------------------- ### Create Account from Credentials Source: https://docs.rs/instant-acme/latest/src/instant_acme/lib Demonstrates how to create an ACME account using pre-defined credentials. It deserializes the credentials from a JSON string and uses the `Account::builder` to construct and initialize the account. This process involves interacting with ACME server endpoints like 'new-nonce', 'new-account', and 'new-order'. ```rust const CREDENTIALS: &str = r#"{"id":"id","key_pkcs8":"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgJVWC_QzOTCS5vtsJp2IG-UDc8cdDfeoKtxSZxaznM-mhRANCAAQenCPoGgPFTdPJ7VLLKt56RxPlYT1wNXnHc54PEyBg3LxKaH0-sJkX0mL8LyPEdsfL_Oz4TxHkWLJGrXVtNhfH","urls":{"newNonce":"new-nonce","newAccount":"new-acct","newOrder":"new-order", "revokeCert": "revoke-cert"}}"#; Account::builder()? .from_credentials(serde_json::from_str::(CREDENTIALS)?) .await?; Ok(()) ``` -------------------------------- ### Get Challenge Identifier Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Retrieves the identifier associated with the current challenge. This is a simple getter method providing access to the challenge's identifier. ```rust /// The identifier for this challenge's authorization pub fn identifier(&self) -> &AuthorizedIdentifier<'_> { &self.identifier } ``` -------------------------------- ### DefaultClient Initialization Source: https://docs.rs/instant-acme/latest/src/instant_acme/lib Provides methods for creating a `DefaultClient` which uses `hyper-rustls` for HTTPS connections. It supports creating a client with platform-specific certificate verification or with custom root certificates. ```rust struct DefaultClient(HyperClient, BodyWrapper>); impl DefaultClient { fn try_new() -> Result { Ok(Self::new( hyper_rustls::HttpsConnectorBuilder::new() .try_with_platform_verifier() .map_err(|e| Error::Other(Box::new(e)))?, )) } fn with_roots(roots: rustls::RootCertStore) -> Result { Ok(Self::new( hyper_rustls::HttpsConnectorBuilder::new().with_tls_config( rustls::ClientConfig::builder() .with_root_certificates(roots) .with_no_client_auth(), ), )) } fn new(builder: HttpsConnectorBuilder) -> Self { Self( HyperClient::builder(TokioExecutor::new()) .build(builder.https_only().enable_http1().enable_http2().build()), ) } } ``` -------------------------------- ### Get ACME Nonce Source: https://docs.rs/instant-acme/latest/src/instant_acme/lib Retrieves an ACME nonce. If a nonce is provided directly, it is returned. Otherwise, it initiates a request to fetch a new nonce. ```rust async fn nonce(&self, nonce: Option) -> Result { if let Some(nonce) = nonce { return Ok(nonce); } // Logic to fetch new nonce if not provided would go here // For this snippet, we assume it's handled elsewhere or the provided nonce is used. unimplemented!("Nonce fetching logic not shown in this snippet"); } ``` -------------------------------- ### Instant ACME Crate Overview Source: https://docs.rs/instant-acme/latest/src/instant_acme/lib This section provides an overview of the instant-acme crate, including its version, license, source code links, and dependencies. It highlights that 100% of the crate is documented and lists supported platforms and feature flags. ```rust Crate: instant-acme Version: 0.8.2 License: Apache-2.0 Description: Async pure-Rust ACME client Dependencies: - async-trait ^0.1 - aws-lc-rs ^1.8.0 (optional) - base64 ^0.22 - bytes ^1 - http ^1 - http-body ^1 - http-body-util ^0.1.2 - httpdate ^1.0.3 - hyper ^1.3.1 (optional) - hyper-rustls ^0.27.7 (optional) - hyper-util ^0.1.5 (optional) - rcgen ^0.14.2 (optional) - ring ^0.17 (optional) - rustls ^0.23 (optional) - rustls-pki-types ^1.1.0 - serde ^1.0.104 - serde_json ^1.0.78 - thiserror ^2.0.3 - time ^0.3 (optional) - tokio ^1.22 - x509-parser ^0.17 (optional) Dev Dependencies: - anyhow ^1.0.66 - clap ^4.0.29 - rustls ^0.23 - tempfile ^3 - tokio ^1.22.0 - tracing ^0.1.37 - tracing-subscriber ^0.3.16 Supported Platforms: - i686-unknown-linux-gnu - x86_64-unknown-linux-gnu Documentation Coverage: 100% ``` -------------------------------- ### SuggestedWindow Struct Source: https://docs.rs/instant-acme/latest/src/instant_acme/types Defines a suggested renewal window for a certificate, specified by a start and end OffsetDateTime. This structure adheres to RFC 9773 and is enabled by the 'time' feature. ```rust /// A suggested renewal window for a certificate /// /// See #[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "camelCase")] #[cfg(feature = "time")] pub struct SuggestedWindow { /// The start [`OffsetDateTime`] of the suggested renewal window #[serde(with = "time::serde::rfc3339")] pub start: OffsetDateTime, /// The end [`OffsetDateTime`] of the suggested renewal window #[serde(with = "time::serde::rfc3339")] pub end: OffsetDateTime, } ``` -------------------------------- ### instant-acme Source Files Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Lists the source files for the instant-acme crate, including account.rs, lib.rs, order.rs, and types.rs. Links to the documentation and source code for each file are provided. ```Rust account.rs lib.rs order.rs types.rs ``` -------------------------------- ### RetryPolicy::state() - Get Retry State Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Returns the current retry state based on the policy's configuration. This method is likely used internally to manage retry attempts. ```rust fn state(&self) -> RetryState { RetryState { delay: self.delay, } } ``` -------------------------------- ### ChallengeHandle Methods Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Provides methods for interacting with ACME challenges. The `set_ready` method notifies the ACME server that a challenge is ready to be completed. The `send_device_attestation` method is specifically for the device-attest-01 challenge type, sending device attestation data to the server. ```rust pub struct ChallengeHandle<'a> { identifier: AuthorizedIdentifier<'a>, challenge: &'a Challenge, nonce: &'a mut Option, account: &'a AccountInner, } impl ChallengeHandle<'_> { /// Notify the server that the given challenge is ready to be completed pub async fn set_ready(&mut self) -> Result<(), Error> { let rsp = self .account .post(Some(&Empty {}), self.nonce.take(), &self.challenge.url) .await?; *self.nonce = nonce_from_response(&rsp); let response = Problem::check::(rsp).await?; match response.error { Some(details) => Err(Error::Api(details)), None => Ok(()), } } /// Notify the server that the challenge is ready by sending a device attestation /// /// This function is for the ACME challenge device-attest-01. It should not be used /// with other challenge types. /// See for details. /// /// `payload` is the device attestation object as defined in link. Provide the attestation /// object as a raw blob. Base64 encoding of the attestation object `payload.att_obj` /// is done by this function. pub async fn send_device_attestation( &mut self, payload: &DeviceAttestation<'_>, ) -> Result<(), Error> { // Implementation details for sending device attestation would go here. // This is a placeholder based on the provided context. unimplemented!(); } } ``` -------------------------------- ### Get Order Identifiers Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Retrieves the identifiers associated with an ACME order's authorizations. This method returns an iterator over the identifiers. If the identifiers have not been fetched previously, it will perform a network request. If the authorization stream has already been consumed, this operation will not involve network activity. ```rust /// Retrieve the identifiers for this order /// /// This method will retrieve the identifiers attached to the authorizations for this order /// if they have not been retrieved yet. If you have already consumed the stream generated /// by [`Order::authorizations()`], this will not involve any network activity. pub fn identifiers(&mut self) -> Identifiers<'_> { Identifiers { inner: AuthStream { iter: self.state.authorizations.iter_mut(), nonce: &mut self.nonce, account: &self.account, }, } } ``` -------------------------------- ### instant-acme Supported Platforms Source: https://docs.rs/instant-acme/latest/index Lists the target platforms for which the instant-acme crate documentation is available on docs.rs. ```rust i686-unknown-linux-gnu x86_64-unknown-linux-gnu ``` -------------------------------- ### Rust Renewal Info Test Source: https://docs.rs/instant-acme/latest/src/instant_acme/types This Rust code snippet demonstrates a test case for handling renewal information. It deserializes a JSON string into a `RenewalInfo` struct and asserts the correctness of the parsed data, specifically the explanation URL and the start and end days of the suggested window. This functionality is conditional on the 'time' feature being enabled. ```rust #[cfg(feature = "time")] fn renewal_info() { const INFO: &str = r#"{ "suggestedWindow": { "start": "2025-01-02T04:00:00Z", "end": "2025-01-03T04:00:00Z" }, "explanationURL": "https://acme.example.com/docs/ari" }"#; let info = serde_json::from_str::(INFO).unwrap(); assert_eq!( info.explanation_url.unwrap(), "https://acme.example.com/docs/ari" ); let window = info.suggested_window; assert_eq!(window.start.day(), 2); assert_eq!(window.end.day(), 3); } ``` ```json { "suggestedWindow": { "start": "2025-01-02T04:00:00Z", "end": "2025-01-03T04:00:00Z" }, "explanationURL": "https://acme.example.com/docs/ari" } ``` -------------------------------- ### instant-acme Supported Platforms Source: https://docs.rs/instant-acme/latest/instant_acme/index Lists the target platforms for which the instant-acme crate has been built and documented. ```Rust Supported Platforms: i686-unknown-linux-gnu x86_64-unknown-linux-gnu ``` -------------------------------- ### instant-acme Crate Information Source: https://docs.rs/instant-acme/latest/instant_acme/index Provides an overview of the instant-acme Rust crate, including its version, license, source code links, and dependencies. It also indicates the documentation coverage percentage. ```Rust Crate: instant_acme 0.8.2 License: Apache-2.0 Source: https://github.com/djc/instant-acme Dependencies: async-trait ^0.1 aws-lc-rs ^1.8.0 (optional) base64 ^0.22 bytes ^1 http ^1 http-body ^1 http-body-util ^0.1.2 httpdate ^1.0.3 hyper ^1.3.1 (optional) hyper-rustls ^0.27.7 (optional) hyper-util ^0.1.5 (optional) rcgen ^0.14.2 (optional) ring ^0.17 (optional) rustls ^0.23 (optional) rustls-pki-types ^1.1.0 serde ^1.0.104 serde_json ^1.0.78 thiserror ^2.0.3 time ^0.3 (optional) tokio ^1.22 x509-parser ^0.17 (optional) Documentation Coverage: 100% ``` -------------------------------- ### Account Structure and Builder Pattern Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Defines the ACME Account structure as per RFC 8555 section 7.1.2. It outlines the process of creating an Account using the builder pattern, either from scratch or by restoring from existing credentials. This includes setting up the necessary HTTP client and potentially TLS configurations. ```rust /// An ACME account as described in RFC 8555 (section 7.1.2) /// /// Create an [`Account`] via [`Account::builder()`] or [`Account::builder_with_http()`], /// then use [`AccountBuilder::create()`] to create a new account or restore one from /// serialized data by passing deserialized [`AccountCredentials`] to /// [`AccountBuilder::from_credentials()`]. ``` -------------------------------- ### instant-acme Supported Platforms Source: https://docs.rs/instant-acme/latest/instant_acme Lists the target platforms for which the instant-acme crate documentation is available on docs.rs. ```rust i686-unknown-linux-gnu x86_64-unknown-linux-gnu ``` -------------------------------- ### AccountBuilder Initialization Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Provides functionality to build an Account instance. The AccountBuilder is used to construct new accounts or restore existing ones from credentials. It requires an HttpClient implementation to perform network operations. ```rust pub struct AccountBuilder { http: Box, } impl AccountBuilder { /// Restore an existing account from the given credentials /// /// The [`AccountCredentials`] type is opaque, but supports deserialization. #[allow(clippy::wrong_self_convention)] pub async fn from_credentials(self, credentials: AccountCredentials) -> Result { Ok(Account { // ... implementation details ... }) } } ``` -------------------------------- ### Account Builder with Default HTTP Client Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Provides a method to create an AccountBuilder using the default HTTP client. This is the standard way to initialize the builder when no custom TLS configuration is needed. Requires the 'hyper-rustls' feature. ```rust #[cfg(feature = "hyper-rustls")] pub fn builder() -> Result { Ok(AccountBuilder { http: Box::new(DefaultClient::try_new()?), }) } ``` -------------------------------- ### instant-acme Crate Overview Source: https://docs.rs/instant-acme/latest/instant_acme/enum Provides an overview of the instant-acme Rust crate, including its version, license, source code links, and dependencies. It also highlights the documentation status and supported platforms. ```rust Crate: instant-acme Version: 0.8.2 License: Apache-2.0 Source: https://github.com/djc/instant-acme Dependencies: - async-trait ^0.1 - base64 ^0.22 - bytes ^1 - http ^1 - http-body ^1 - http-body-util ^0.1.2 - httpdate ^1.0.3 - rustls-pki-types ^1.1.0 - serde ^1.0.104 - serde_json ^1.0.78 - thiserror ^2.0.3 - tokio ^1.22 Optional Dependencies: - aws-lc-rs ^1.8.0 - hyper ^1.3.1 - hyper-rustls ^0.27.7 - hyper-util ^0.1.5 - rcgen ^0.14.2 - ring ^0.17 - rustls ^0.23 - time ^0.3 - x509-parser ^0.17 Dev Dependencies: - anyhow ^1.0.66 - clap ^4.0.29 - rustls ^0.23 - tempfile ^3 - tokio ^1.22.0 - tracing ^0.1.37 - tracing-subscriber ^0.3.16 Documentation: 100% complete Platforms: - i686-unknown-linux-gnu - x86_64-unknown-linux-gnu ``` -------------------------------- ### NewOrder Initialization and Configuration Source: https://docs.rs/instant-acme/latest/src/instant_acme/types Provides methods for creating and configuring a `NewOrder` object. The `new` function initializes an order with required identifiers, while `replaces` and `profile` allow for optional configuration. ```APIDOC NewOrder::new(identifiers: &'a [Identifier]) -> Self - Prepares to create a new order for the given identifiers. - This method is intended to be passed into `Account::new_order()`. NewOrder::replaces(mut self, replaces: CertificateIdentifier<'a>) -> Self - Indicates that the `NewOrder` is replacing a previously issued certificate. - The `replaces` parameter should be a `CertificateIdentifier`. - This may offer preferential rate limits or assist in compliance incident handling. - Requires that at least one identifier in the new order was present in the replaced certificate. - May return an error if the ACME CA does not support the ACME renewal information (ARI) extension. NewOrder::profile(mut self, profile: &'a str) -> Self - Sets the profile to be used for the order. - May yield an error if the ACME server does not support the profiles extension or if the specified profile is invalid. ``` -------------------------------- ### KeyAuthorization Methods Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Provides methods for generating and retrieving key authorization values for ACME challenges. Includes methods for HTTP-01, TLS-ALPN-01, and DNS-01 challenges. ```rust pub struct KeyAuthorization(String); impl KeyAuthorization { fn new(challenge: &Challenge, key: &Key) -> Self { Self(format!("{}.{}", challenge.token, &key.thumb)) } /// Get the key authorization value /// /// This can be used for HTTP-01 challenge responses. pub fn as_str(&self) -> &str { &self.0 } /// Get the SHA-256 digest of the key authorization /// /// This can be used for TLS-ALPN-01 challenge responses. /// /// pub fn digest(&self) -> impl AsRef<[u8]> { crypto::digest(&crypto::SHA256, self.0.as_bytes()) } /// Get the base64-encoded SHA256 digest of the key authorization /// /// This can be used for DNS-01 challenge responses. pub fn dns_value(&self) -> String { BASE64_URL_SAFE_NO_PAD.encode(self.digest()) } } ``` -------------------------------- ### instant-acme Supported Platforms Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Lists the target platforms for which the instant-acme crate has been compiled and tested. This indicates the environments where the crate is expected to function correctly. ```Rust i686-unknown-linux-gnu x86_64-unknown-linux-gnu ``` -------------------------------- ### ChallengeHandle Usage Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Describes the usage of ChallengeHandle for interacting with ACME challenges. It outlines the steps required to process a challenge, including obtaining the key authorization, setting up the challenge response, and marking it as ready. ```rust /// Wrapper type for interacting with a [`Challenge`]'s state /// /// For each challenge, you'll need to: /// /// * Obtain the [`ChallengeHandle::key_authorization()`] for the challenge response /// * Set up the challenge response in your infrastructure (details vary by challenge type) /// * Call [`ChallengeHandle::set_ready()`] for that challenge after setup is complete /// ``` -------------------------------- ### instant-acme Crate Information Source: https://docs.rs/instant-acme/latest/index Provides metadata and links related to the instant-acme Rust crate on docs.rs. Includes version information, license, source code repository, and links to crates.io. ```rust Crate: instant-acme Version: 0.8.2 License: Apache-2.0 Repository: https://github.com/djc/instant-acme Crates.io: https://crates.io/crates/instant-acme ``` -------------------------------- ### instant-acme Crate Information Source: https://docs.rs/instant-acme/latest/instant_acme Provides metadata and links related to the instant-acme Rust crate on docs.rs. Includes version information, license, source code repository, and links to crates.io. ```rust Crate: instant-acme Version: 0.8.2 License: Apache-2.0 Repository: https://github.com/djc/instant-acme Crates.io: https://crates.io/crates/instant-acme ``` -------------------------------- ### instant-acme Supported Platforms Source: https://docs.rs/instant-acme/latest/instant_acme/all Lists the target platforms for which the instant-acme crate has been built and tested. This includes common Linux architectures. ```Rust i686-unknown-linux-gnu x86_64-unknown-linux-gnu ``` -------------------------------- ### Instant Acme Crate Overview Source: https://docs.rs/instant-acme/latest/instant_acme/index This section provides a high-level overview of the instant_acme Rust crate, highlighting its purpose as an asynchronous ACME client compliant with RFC 8555. It also links to related documentation for settings and help. ```rust Project: /websites/rs_instant-acme Content: ### Crates * [instant_acme](https://docs.rs/instant-acme/latest/instant_acme/index.html) [](https://docs.rs/instant-acme/latest/instant_acme/all.html "show sidebar") # Crate instant_acmeCopy item path [Settings](https://docs.rs/instant-acme/latest/settings.html) [Help](https://docs.rs/instant-acme/latest/help.html) Summary[Source](https://docs.rs/instant-acme/latest/src/instant_acme/lib.rs.html#1-431) Expand description Async pure-Rust ACME (RFC 8555) client. ``` -------------------------------- ### Source Code Source: https://docs.rs/instant-acme/latest/index Direct link to the source code of the instant_acme crate, specifically the main library file. This allows developers to inspect the implementation details. ```rust https://docs.rs/instant-acme/latest/src/instant_acme/lib.rs.html#1-431 ``` -------------------------------- ### instant-acme Dependencies Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Lists the normal, optional, and development dependencies for the instant-acme crate. Dependencies include async-trait, base64, bytes, http, serde, tokio, and others, with optional features like aws-lc-rs, hyper, and rustls. ```Rust async-trait ^0.1 aws-lc-rs ^1.8.0 _optional_ base64 ^0.22 bytes ^1 http ^1 http-body ^1 http-body-util ^0.1.2 httpdate ^1.0.3 hyper ^1.3.1 _optional_ hyper-rustls ^0.27.7 _optional_ hyper-util ^0.1.5 _optional_ rcgen ^0.14.2 _optional_ ring ^0.17 _optional_ rustls ^0.23 _optional_ rustls-pki-types ^1.1.0 serde ^1.0.104 serde_json ^1.0.78 thiserror ^2.0.3 time ^0.3 _optional_ tokio ^1.22 x509-parser ^0.17 _optional_ # Dev Dependencies anyhow ^1.0.66 clap ^4.0.29 rustls ^0.23 tempfile ^3 tokio ^1.22.0 tracing ^0.1.37 tracing-subscriber ^0.3.16 ``` -------------------------------- ### Load ACME Account from Key Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Loads an existing ACME account using a provided private key. This method is useful for restoring a previously created account. It returns the account details and credentials. An error is returned if no matching account is found on the server. ```rust pub async fn from_key( self, key: (Key, PrivateKeyDer<'static>), directory_url: String, ) -> Result<(Account, AccountCredentials), Error> { Self::create_inner( &NewAccount { contact: &[], terms_of_service_agreed: true, only_return_existing: true, }, key, None, ) .await } ``` -------------------------------- ### instant-acme Dependencies Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Lists the normal and development dependencies for the instant-acme crate. Normal dependencies are required for the crate's core functionality, while dev-dependencies are used for testing and development. ```Rust async-trait ^0.1 base64 ^0.22 bytes ^1 http ^1 http-body ^1 http-body-util ^0.1.2 httpdate ^1.0.3 rustls-pki-types ^1.1.0 serde ^1.0.104 serde_json ^1.0.78 thiserror ^2.0.3 tokio ^1.22 ``` -------------------------------- ### Account Builder with Custom HTTP Client Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Enables the creation of an AccountBuilder using a pre-configured HTTP client. This offers maximum flexibility for integrating with custom network stacks or configurations. ```rust pub fn builder_with_http(http: Box) -> AccountBuilder { AccountBuilder { http } } ``` -------------------------------- ### Rustdoc Keyboard Shortcuts Source: https://docs.rs/instant-acme/latest/help This section details the keyboard shortcuts available within the Rustdoc documentation interface for efficient navigation and interaction. ```APIDOC `?` Show this help dialog `S` / `/` Focus the search field `↑` Move up in search results `↓` Move down in search results `←` / `→` Switch result tab (when results focused) `⏎` Go to active search result `+` Expand all sections `-` Collapse all sections ``` -------------------------------- ### Create New ACME Account Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Creates a new ACME account on a specified directory URL. It generates a new private key and returns the account details along with credentials for future use. Optionally accepts an external account key. ```rust pub async fn create( self, account: &NewAccount<'_>, directory_url: String, external_account: Option<&ExternalAccountKey>, ) -> Result<(Account, AccountCredentials), Error> { let (key, key_pkcs8) = Key::generate()?; Self::create_inner( account, (key, key_pkcs8), external_account, Client::new(directory_url, self.http).await?, ) .await } ``` -------------------------------- ### instant-acme Dependencies Source: https://docs.rs/instant-acme/latest/index Lists the direct and development dependencies for the instant-acme crate version 0.8.2. Dependencies include async-trait, base64, bytes, http, serde, tokio, and others, with optional dependencies for hyper, rustls, and x509-parser. ```rust async-trait ^0.1 aws-lc-rs ^1.8.0 _optional_ base64 ^0.22 bytes ^1 http ^1 http-body ^1 http-body-util ^0.1.2 httpdate ^1.0.3 hyper ^1.3.1 _optional_ hyper-rustls ^0.27.7 _optional_ hyper-util ^0.1.5 _optional_ rcgen ^0.14.2 _optional_ ring ^0.17 _optional_ rustls ^0.23 _optional_ rustls-pki-types ^1.1.0 serde ^1.0.104 serde_json ^1.0.78 thiserror ^2.0.3 time ^0.3 _optional_ tokio ^1.22 x509-parser ^0.17 _optional_ # Dev Dependencies anyhow ^1.0.66 clap ^4.0.29 rustls ^0.23 tempfile ^3 tokio ^1.22.0 tracing ^0.1.37 tracing-subscriber ^0.3.16 ``` -------------------------------- ### instant-acme Dependencies Source: https://docs.rs/instant-acme/latest/settings Lists the normal, optional, and development dependencies for the instant-acme crate. These dependencies are crucial for the crate's functionality, including asynchronous operations, HTTP handling, and certificate management. ```rust async-trait ^0.1 aws-lc-rs ^1.8.0 _optional_ base64 ^0.22 bytes ^1 http ^1 http-body ^1 http-body-util ^0.1.2 httpdate ^1.0.3 hyper ^1.3.1 _optional_ hyper-rustls ^0.27.7 _optional_ hyper-util ^0.1.5 _optional_ rcgen ^0.14.2 _optional_ ring ^0.17 _optional_ rustls ^0.23 _optional_ rustls-pki-types ^1.1.0 serde ^1.0.104 serde_json ^1.0.78 thiserror ^2.0.3 time ^0.3 _optional_ tokio ^1.22 x509-parser ^0.17 _optional_ # Dev dependencies anyhow ^1.0.66 clap ^4.0.29 rustls ^0.23 tempfile ^3 tokio ^1.22.0 tracing ^0.1.37 tracing-subscriber ^0.3.16 ``` -------------------------------- ### instant-acme Supported Platforms Source: https://docs.rs/instant-acme/latest/src/instant_acme/types Lists the target platforms for which the instant-acme crate has been built and tested. This indicates the environments where the crate is expected to function correctly. ```rust i686-unknown-linux-gnu x86_64-unknown-linux-gnu ``` -------------------------------- ### instant-acme Platform Support Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Indicates the target platforms for which the instant-acme crate has been built and tested. Supported platforms include i686-unknown-linux-gnu and x86_64-unknown-linux-gnu. ```Rust i686-unknown-linux-gnu x86_64-unknown-linux-gnu ``` -------------------------------- ### instant-acme Dependencies Source: https://docs.rs/instant-acme/latest/instant_acme Lists the direct and development dependencies for the instant-acme crate version 0.8.2. Dependencies include async-trait, base64, bytes, http, serde, tokio, and others, with optional dependencies for hyper, rustls, and x509-parser. ```rust async-trait ^0.1 aws-lc-rs ^1.8.0 _optional_ base64 ^0.22 bytes ^1 http ^1 http-body ^1 http-body-util ^0.1.2 httpdate ^1.0.3 hyper ^1.3.1 _optional_ hyper-rustls ^0.27.7 _optional_ hyper-util ^0.1.5 _optional_ rcgen ^0.14.2 _optional_ ring ^0.17 _optional_ rustls ^0.23 _optional_ rustls-pki-types ^1.1.0 serde ^1.0.104 serde_json ^1.0.78 thiserror ^2.0.3 time ^0.3 _optional_ tokio ^1.22 x509-parser ^0.17 _optional_ # Dev Dependencies anyhow ^1.0.66 clap ^4.0.29 rustls ^0.23 tempfile ^3 tokio ^1.22.0 tracing ^0.1.37 tracing-subscriber ^0.3.16 ``` -------------------------------- ### AuthorizationHandle Documentation Source: https://docs.rs/instant-acme/latest/src/instant_acme/order Provides documentation for the `AuthorizationHandle` struct, explaining its role in ACME authorization processes, including how to retrieve and complete challenges. ```rust /// An ACME authorization as described in RFC 8555 (section 7.1.4) /// /// Authorizations are retrieved from an associated [`Order`] by calling /// [`Order::authorizations()`]. This type dereferences to the underlying /// [`AuthorizationState`] for easy access to the authorization's state. /// /// For each authorization, you'll need to: /// /// * Select which [`ChallengeType`] you want to complete /// * Call [`AuthorizationHandle::challenge()`] to get a [`ChallengeHandle`] /// * Use the `ChallengeHandle` to complete the authorization's challenge /// /// ``` -------------------------------- ### Create New Order Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Method to initiate a new ACME order. It takes a `NewOrder` struct as input, which contains the necessary details for requesting a new order from the ACME server. ```rust /// Create a new order based on the given [`NewOrder`] pub fn new_order(&self, new_order: NewOrder) -> Result { // ... implementation details ... } ``` -------------------------------- ### instant-acme Feature Flags Source: https://docs.rs/instant-acme/latest/index Provides a link to browse the available feature flags for the instant-acme-0.8.2 crate. ```rust Feature Flags: https://docs.rs/crate/instant-acme/latest/features ``` -------------------------------- ### instant-acme Supported Platforms Source: https://docs.rs/instant-acme/latest/settings Indicates the target platforms for which the instant-acme crate has been tested or is known to be compatible. This information is useful for cross-compilation and deployment. ```rust i686-unknown-linux-gnu x86_64-unknown-linux-gnu ``` -------------------------------- ### Directory Struct for ACME Server Information Source: https://docs.rs/instant-acme/latest/src/instant_acme/types Represents the ACME server's directory, containing URLs for essential operations like obtaining a new nonce, creating new accounts, and creating new orders. Some fields might be absent in older server responses. ```rust struct Directory { pub new_nonce: String, pub new_account: String, pub new_order: String, // The fields below were added later and old `AccountCredentials` may not have it. } ``` -------------------------------- ### Account Credentials Structure Source: https://docs.rs/instant-acme/latest/src/instant_acme/account Defines the structure for account credentials, including the account ID, PKCS8 key, directory URL, and associated URLs. ```APIDOC AccountCredentials: id: string key_pkcs8: string directory: Option urls: Option ``` -------------------------------- ### instant-acme Dependencies Source: https://docs.rs/instant-acme/latest/instant_acme/struct Lists the dependencies for the instant-acme crate version 0.8.2. It includes normal, optional, and development dependencies with their respective version constraints. ```rust async-trait ^0.1 aws-lc-rs ^1.8.0 (optional) base64 ^0.22 bytes ^1 http ^1 http-body ^1 http-body-util ^0.1.2 httpdate ^1.0.3 hyper ^1.3.1 (optional) hyper-rustls ^0.27.7 (optional) hyper-util ^0.1.5 (optional) rcgen ^0.14.2 (optional) ring ^0.17 (optional) ustls ^0.23 (optional) rustls-pki-types ^1.1.0 serde ^1.0.104 serde_json ^1.0.78 thiserror ^2.0.3 time ^0.3 (optional) tokio ^1.22 x509-parser ^0.17 (optional) --dev dependencies-- anyhow ^1.0.66 clap ^4.0.29 rustls ^0.23 tempfile ^3 tokio ^1.22.0 tracing ^0.1.37 tracing-subscriber ^0.3.16 ``` -------------------------------- ### instant-acme Dependencies Source: https://docs.rs/instant-acme/latest/src/instant_acme/types Lists the normal and development dependencies for the instant-acme crate. Normal dependencies are required for the crate's functionality, while dev-dependencies are used for testing and development. ```rust async-trait ^0.1 aws-lc-rs ^1.8.0 (optional) base64 ^0.22 bytes ^1 http ^1 http-body ^1 http-body-util ^0.1.2 httpdate ^1.0.3 hyper ^1.3.1 (optional) hyper-rustls ^0.27.7 (optional) hyper-util ^0.1.5 (optional) rcgen ^0.14.2 (optional) ring ^0.17 (optional) rustls ^0.23 (optional) rustls-pki-types ^1.1.0 serde ^1.0.104 serde_json ^1.0.78 thiserror ^2.0.3 time ^0.3 (optional) tokio ^1.22 x509-parser ^0.17 (optional) # Dev Dependencies anyhow ^1.0.66 clap ^4.0.29 rustls ^0.23 tempfile ^3 tokio ^1.22.0 tracing ^0.1.37 tracing-subscriber ^0.3.16 ```