ExAcme.OrderRequest (ExAcme v0.2.0)

View Source

Represents an ACME Order request.

Provides functionalities to build and submit order requests to the ACME server.

Attributes

  • identifiers - List of identifiers for the order.
  • profile - The profile to apply to the order.
  • not_before - Request start time for the certificate.
  • not_after - Request end time for the certificate.

Summary

Types

t()

ACME Order request object

Functions

Adds a DNS identifier to the order request.

Adds an identifier to the order request.

Creates a new order request with default values.

Sets the requested end time for the certificate.

Sets the requested start time for the certificate.

Sets the profile for the order request.

Submits the order request to the ACME server.

Types

t()

@type t() :: %ExAcme.OrderRequest{
  identifiers: [%{type: String.t(), value: String.t()}],
  not_after: DateTime.t() | nil,
  not_before: DateTime.t() | nil,
  profile: String.t() | nil
}

ACME Order request object

Functions

add_dns_identifier(order, domain)

@spec add_dns_identifier(t(), String.t()) :: t()

Adds a DNS identifier to the order request.

Parameters

  • order - The current order request.
  • domain - The domain name to add.

Returns

  • Updated %ExAcme.OrderRequest{} struct.

add_identifier(order, type, value)

Adds an identifier to the order request.

Parameters

  • order - The current order request.
  • type - The type of identifier (e.g., "dns").
  • value - The value of the identifier (e.g., domain name).

Returns

  • Updated %ExAcme.OrderRequest{} struct.

new()

@spec new() :: t()

Creates a new order request with default values.

Returns

  • %ExAcme.OrderRequest{} struct.

not_after(order, date)

@spec not_after(t(), DateTime.t()) :: t()

Sets the requested end time for the certificate.

Parameters

  • order - The current order request.
  • date - The end datetime.

Returns

  • Updated %ExAcme.OrderRequest{} struct.

not_before(order, date)

@spec not_before(t(), DateTime.t()) :: t()

Sets the requested start time for the certificate.

Parameters

  • order - The current order request.
  • date - The start datetime.

Returns

  • Updated %ExAcme.OrderRequest{} struct.

profile(order, profile)

@spec profile(t(), String.t()) :: t()

Sets the profile for the order request.

Parameters

  • order - The current order request.
  • profile - The profile name.

Returns

  • Updated %ExAcme.OrderRequest{} struct.

submit(order, account_key, client)

@spec submit(t(), ExAcme.AccountKey.t(), ExAcme.client()) ::
  {:ok, ExAcme.Order.t()} | {:error, term()}

Submits the order request to the ACME server.

Parameters

  • order - The order request to submit.
  • key - The account key for authentication.
  • client - The ExAcme client agent.

Returns

  • {:ok, order} on success.
  • {:error, reason} on failure.