ExAcme.AccountKey (ExAcme v0.2.0)
View SourceHandles the ACME account key operations.
Provides functionalities to generate keys, sign requests, and manage key identifiers.
Attributes
key
- The JOSE JSON Web Key (JWK).type
- The type of the key (e.g., :ec256, :ed25519).kid
- The Key ID assigned by the server.
Summary
Functions
Deserializes the account key from JSON.
Generates a new account key.
Signs a request body with the account key.
Generates the thumbprint of the account key.
Serializes the account key to JSON.
Converts the account key to its public representation.
Updates the Key ID (KID) of the account key.
Types
@type t() :: %ExAcme.AccountKey{ key: JOSE.JWK.t(), kid: String.t() | nil, type: atom() }
Account key for authenticating requests
Functions
Deserializes the account key from JSON.
Parameters
json
- The JSON string representing the account key.
Returns
{:ok, %ExAcme.AccountKey{}}
on success.{:error, reason}
on failure.
Generates a new account key.
Parameters
type
- The type of key to generate (:ec256 or :ed25519). Defaults to :ec256.
Returns
%ExAcme.AccountKey{}
struct.
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 JWS.
Generates the thumbprint of the account key.
Parameters
account_key
- The account key.
Returns
- The thumbprint as a string.
Serializes the account key to JSON.
Parameters
account_key
- The account key.
Returns
- JSON string representation of the account key.
Converts the account key to its public representation.
Parameters
account_key
- The account key.
Returns
- A map representing the public JWK.
Updates the Key ID (KID) of the account key.
Parameters
key
- The account key.kid
- The new Key ID.
Returns
- Updated
%ExAcme.AccountKey{}
struct.