ExAcme.Registration (ExAcme v0.2.0)

View Source

Represents an ACME Account registration.

Provides functionalities to create and manage account registrations with the ACME server.

Attributes

  • contact - List of contact URIs.
  • terms_of_service_agreed - Boolean indicating agreement to terms.
  • only_return_existing - Boolean to indicate if only existing accounts should be returned.
  • external_account_binding - External account binding information.

Summary

Types

t()

ACME Account registration object

Functions

Agrees to the terms of service for the registration.

Adds contact URIs to the registration.

Creates a new account registration struct with default values.

Registers the account with the ACME server.

Types

t()

@type t() :: %ExAcme.Registration{
  contact: [String.t()],
  external_account_binding: String.t() | nil,
  only_return_existing: boolean(),
  terms_of_service_agreed: boolean()
}

ACME Account registration object

Functions

agree_to_terms(registration)

@spec agree_to_terms(t()) :: t()

Agrees to the terms of service for the registration.

Parameters

  • registration - The current registration struct.

Returns

  • Updated %ExAcme.Registration{} struct.

contacts(registration, contacts)

@spec contacts(t(), [String.t()] | String.t()) :: t()

Adds contact URIs to the registration.

Parameters

  • registration - The current registration struct.
  • contacts - A list or single contact URI.

Returns

  • Updated %ExAcme.Registration{} struct.

new()

@spec new() :: t()

Creates a new account registration struct with default values.

Returns

  • %ExAcme.Registration{} struct.

register(registration, account_key, client, opts \\ [])

Registers the account with the ACME server.

Parameters

  • registration - The registration struct.
  • account_key - The account key for authentication.
  • client - The ExAcme client agent.
  • opts - Optional parameters.

Options

  • :only_return_existing - If true, only existing accounts will be returned.

Returns

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