# `OpenPayments.Types.JWKS`
[🔗](https://github.com/interledger/open-payments-elixir/blob/v1.0.0/lib/open_payments/types/jwks.ex#L1)

A public JSON Web Key Set returned by a wallet address server.

The shared schema requires a `keys` array and forbids other top-level fields.
Each entry is decoded to an `OpenPayments.Types.JWK`. Empty arrays and repeated
key IDs are permitted by the schema; selecting a usable key is a separate step.
Validation errors include array indexes, such as `keys[0].x`.

Struct literals can bypass validation. Call `validate/1` after constructing or
modifying a struct; `to_map/1` only converts its shape.

# `t`

```elixir
@type t() :: %OpenPayments.Types.JWKS{keys: [OpenPayments.Types.JWK.t()]}
```

# `from_map`

```elixir
@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}
```

Decodes and validates a public JWKS JSON object.

# `to_map`

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

Converts a public JWKS to its JSON representation without validating it.

# `validate`

```elixir
@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}
```

Validates a JWKS struct and every contained JWK struct.

---

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