Local Keys

Local keys are generated and stored by the wallet as JWKs in the configured DB if persistence is enabled. This page covers generating a key, importing existing key material, and listing or deleting keys. The examples use http://localhost:7005 as the base URL.

See Key Management for how the wallet chooses a default key.


Generate a Key

Create a new key in the wallet's key store.

CURL

Endpoint: POST /wallet/{walletId}/keys/generate | API Reference

Example Request
curl -X POST http://localhost:7005/wallet/{walletId}/keys/generate \
  -H 'Content-Type: application/json' \
  -d '{ "keyType": "Ed25519" }'

Path Parameters

  • walletId: String (required) - The wallet to add the key to. See Managing Wallets.

Body Parameters

  • keyType: String (optional) - One of Ed25519, secp256r1, secp256k1, RSA. Defaults to Ed25519.

Example Response
{
  "keyId": "UneoCeKrx7t0SBINBZQOaSCCzvhgpK8tRS3NEG4pCfU",
  "keyType": "Ed25519"
}

Response Fields

  • keyId: String - The new key's ID. Use it as keyId when receiving, presenting, or creating a DID.
  • keyType: String - The key type.

Import a Key

Import existing key material as a JWK.

CURL

Endpoint: POST /wallet/{walletId}/keys/import | API Reference

Example Request
curl -X POST http://localhost:7005/wallet/{walletId}/keys/import \
  -H 'Content-Type: application/json' \
  -d '{
    "key": {
      "type": "jwk",
      "jwk": { "kty": "OKP", "crv": "Ed25519", "x": "...", "d": "..." }
    }
  }'

Path Parameters

  • walletId: String (required) - The wallet to import the key into.

Body Parameters

  • key: Object (required) - The serialized key. type is jwk, and jwk carries the JWK (include the private d component for a signing key).

Example Response
{
  "keyId": "UneoCeKrx7t0SBINBZQOaSCCzvhgpK8tRS3NEG4pCfU",
  "keyType": "Ed25519"
}

List Keys

List the metadata of all keys across the wallet's key stores.

CURL

Endpoint: GET /wallet/{walletId}/keys | API Reference

Example Request
curl http://localhost:7005/wallet/{walletId}/keys

Path Parameters

  • walletId: String (required) - The wallet whose keys you want to list.

Example Response
[
  { "keyId": "UneoCeKrx7t0SBINBZQOaSCCzvhgpK8tRS3NEG4pCfU", "keyType": "Ed25519" }
]

Get a Key

Fetch a single key's metadata.

CURL

Endpoint: GET /wallet/{walletId}/keys/{keyId} | API Reference

Example Request
curl http://localhost:7005/wallet/{walletId}/keys/{keyId}

Path Parameters

  • walletId: String (required) - The wallet holding the key.
  • keyId: String (required) - The key to fetch. Obtain it from list keys or the generate/import response.

Example Response
{ "keyId": "UneoCeKrx7t0SBINBZQOaSCCzvhgpK8tRS3NEG4pCfU", "keyType": "Ed25519" }

Delete a Key

CURL

Endpoint: DELETE /wallet/{walletId}/keys/{keyId} | API Reference

Example Request
curl -X DELETE http://localhost:7005/wallet/{walletId}/keys/{keyId}

Path Parameters

  • walletId: String (required) - The wallet holding the key.
  • keyId: String (required) - The key to delete.

Example Response

204 No Content on success, or 404 Not Found if the key doesn't exist.


Next Steps

Last updated on July 13, 2026