# `ExAcme.AccountKey`
[🔗](https://github.com/jtdowney/ex_acme/blob/main/lib/ex_acme/account_key.ex#L1)

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.

# `t`

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

Account key for authenticating requests

# `new`

```elixir
@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

  - A new `ExAcme.AccountKey` struct.

# `sign`

```elixir
@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`

```elixir
@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`

```elixir
@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).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
