# Signing keys

> Ed25519 or ES256 signing keys per owner: the private JWK in Supabase Vault, one active key per owner, rotation that keeps a retired kid in the JWKS until the latest exp a signer noted, and a purge. Only the service role calls it; createSigningKeys() in better-supabase/blocks/signing-keys generates keys and signs with WebCrypto.

- Category: Developer platform
- Module: `signing-keys`
- Modes: `managed`
- Docs: https://bettersupabase.com/docs/blocks/signing-keys
- Page: https://bettersupabase.com/blocks/signing-keys

## Install

```bash
npx better-supabase add signing-keys
```

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Modes: "managed". The default is "managed".
    "signing-keys": { mode: "managed" },
  },
});
```

## Client

The block has no React entry yet. Its server-side TypeScript is in `better-supabase/blocks/signing-keys`.

## Events

- `signing_key.created`
- `signing_key.retired`

## Related blocks

Works with: [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md)

## Recipes

- [Signing keys rotation](https://bettersupabase.com/recipes/signing-keys-rotation.md): The active and previous signing keys with a button to rotate them.
