ExAcme.RegistrationBuilder (ExAcme v0.5.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.

Configures the external account binding for the registration.

Creates a new account registration struct with default values.

Converts the registration struct to a map.

Types

t()

@type t() :: %ExAcme.RegistrationBuilder{
  contact: [String.t()],
  external_account_binding: map() | 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

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

external_account_binding(registration, key, client, eab_kid, eab_mac_key)

@spec external_account_binding(
  t(),
  JOSE.JWK.t(),
  ExAcme.client(),
  String.t(),
  String.t()
) :: t()

Configures the external account binding for the registration.

This function sets up an external account binding using the provided key, client, external account binding key ID, and MAC key.

Parameters

  • registration - The current registration struct.
  • key - The JOSE.JWK key being registered.
  • client - The ExAcme client name or pid.
  • eab_kid - The external account binding key ID.
  • eab_mac_key - The external account binding MAC key. This must be a valid base64url-encoded string.

Returns

new_registration()

@spec new_registration() :: t()

Creates a new account registration struct with default values.

Returns

to_map(registration)

@spec to_map(t()) :: map()

Converts the registration struct to a map.

This function transforms the RegistrationBuilder struct into a map format, removes nil values, and converts keys to camelCase for API compatibility.

Parameters

  • registration - The current registration struct.

Returns

  • A map representation of the registration.