SaltDns. Certificates. Issuer. ACME. Client
(Salt v1.0.0)
The one place that talks to the ex_acme library. Everything else in the
certificate module speaks to SaltDns.Certificates.Issuer, and
SaltDns.Certificates.Issuer.ACME speaks to this module, so a change in the
library (or its fork) is a change here only.
What is done here rather than by the library today:
new_order/3builds the order map itself (identifiers,profile,replaces), which the library sends as is.
Each call starts a short-lived client process for the provider's directory,
linked to the caller, and stops it afterwards. Errors are returned as
{:error, {kind, message}} (see SaltDns.Certificates.Issuer).
Summary
Functions
Downloads the chain as PEM.
The RFC 9773 certificate id of a PEM certificate, or nil.
Fetches and returns a directory document.
The TXT value of a DNS-01 challenge: base64url of the SHA-256 of the key authorisation.
Reads an order again. type is the challenge type the order was made for.
Finishes the order with a DER signing request.
Submits an order for names. Options: :profile, :replaces, :challenge
("dns-01", the default, or "http-01"). Returns the order's address, its
status and the proofs of that challenge type that are still needed.
Registers an account for the provider with a new ES256 key (and its external account binding, if the provider has one). Agreeing to the provider's terms of service is part of registering.
Asks for renewal information (RFC 9773). :unsupported when the directory
has no renewalInfo address.
Tells the provider to validate the pending challenges of the order.
Functions
@spec certificate(SaltDns.Certificates.Provider.t(), String.t()) :: {:ok, String.t()} | {:error, {atom(), String.t()}}
Downloads the chain as PEM.
The RFC 9773 certificate id of a PEM certificate, or nil.
Fetches and returns a directory document.
@spec dns_value(String.t(), ExAcme.AccountKey.t()) :: String.t()
The TXT value of a DNS-01 challenge: base64url of the SHA-256 of the key authorisation.
@spec fetch_order(SaltDns.Certificates.Provider.t(), String.t(), String.t()) :: {:ok, map()} | {:error, {atom(), String.t()}}
Reads an order again. type is the challenge type the order was made for.
@spec finish(SaltDns.Certificates.Provider.t(), String.t(), String.t(), binary()) :: {:ok, map()} | {:error, {atom(), String.t()}}
Finishes the order with a DER signing request.
@spec new_order(SaltDns.Certificates.Provider.t(), [String.t()], keyword()) :: {:ok, map()} | {:error, {atom(), String.t()}}
Submits an order for names. Options: :profile, :replaces, :challenge
("dns-01", the default, or "http-01"). Returns the order's address, its
status and the proofs of that challenge type that are still needed.
@spec register(SaltDns.Certificates.Provider.t()) :: {:ok, %{account_url: String.t(), account_key: binary()}} | {:error, {atom(), String.t()}}
Registers an account for the provider with a new ES256 key (and its external account binding, if the provider has one). Agreeing to the provider's terms of service is part of registering.
@spec renewal_info(SaltDns.Certificates.Provider.t(), String.t()) :: {:ok, map()} | :unsupported | {:error, {atom(), String.t()}}
Asks for renewal information (RFC 9773). :unsupported when the directory
has no renewalInfo address.
@spec respond(SaltDns.Certificates.Provider.t(), [String.t()]) :: :ok | {:error, {atom(), String.t()}}
Tells the provider to validate the pending challenges of the order.