ExAcme.AccountKey (ExAcme v0.3.0)

View Source

Handles the ACME account key operations.

Provides functionalities to generate keys, sign requests, and manage key identifiers.

Attributes

  • key - The JOSE JSON Web Key (JWK).
  • algorithm - The algorithm of the key (e.g., ES256).
  • kid - The Key ID assigned by the server.

Summary

Types

t()

Account key for authenticating requests

Functions

Creates a new account key from a JOSE JSON Web Key (JWK) and the Key ID assigned by the server.

Signs a request body with the account key.

Generates the thumbprint of the account key.

Converts the account key to its public representation.

Types

t()

@type t() :: %ExAcme.AccountKey{
  algorithm: String.t(),
  key: JOSE.JWK.t(),
  kid: String.t()
}

Account key for authenticating requests

Functions

new(key, kid)

@spec new(JOSE.JWK.t(), String.t() | nil) :: t()

Creates a new account key from a JOSE JSON Web Key (JWK) and the Key ID assigned by the server.

Parameters

  • key - The JOSE JSON Web Key (JWK).
  • kid - The Key ID assigned by the server.

Returns

sign(account_key, body, header)

@spec sign(t(), binary(), map()) :: map()

Signs a request body with the account key.

Parameters

  • account_key - The account key.
  • body - The request body to sign.
  • header - Additional headers.

Returns

  • The signed JSON Web Signature (JWS).

thumbprint(account_key)

@spec thumbprint(t()) :: String.t()

Generates the thumbprint of the account key.

Parameters

  • account_key - The account key.

Returns

  • The thumbprint as a string.

to_public(account_key)

@spec to_public(t()) :: map()

Converts the account key to its public representation.

Parameters

  • account_key - The account key.

Returns

  • A map representing the public JSON Web Key (JWK).