Accountmaker Docs
Types

Client Key

Cryptographic key pair for signing tokens, with public key exposed via JWKS endpoint.

cryptography jwt jwks signing keys

Client Key

A Client Key is a cryptographic key pair used for signing tokens. The public key is exposed via JWKS for verification; the private key is never exposed.

Schema

interface ClientKey {
  kid: string; // Key ID used in JWT headers
  credential_id: string; // Client ID (cid...)
  jwk: object; // Public JWK
  public_key: string; // PEM public key
}

Properties

PropertyTypeDescription
kidstringKey ID (kid in JWT header)
credential_idstringClient this key belongs to
jwkobjectPublic JWK representation
public_keystringPEM public key

JWKS Representation

Public keys exposed at /.well-known/jwks.json:

{
  "keys": [
    {
      "kty": "RSA",
      "use": "sig",
      "kid": "key_2kHfPZcN9xW4mE8RtY7vB",
      "alg": "RS256",
      "n": "0vx7agoebG...",
      "e": "AQAB"
    }
  ]
}

Key Rotation

Create New Key

Sign with New Key

Old Key in JWKS

Delete Old Key

Best practices:

  • Rotate keys periodically
  • Keep 2-4 keys active during transition
  • Old keys remain in JWKS for token verification

Example

{
  "kid": "key_2kHfPZcN9xW4mE8RtY7vB",
  "credential_id": "cid_1jGePYbM8wV3lD7QsX6uA",
  "jwk": { "kty": "RSA", "kid": "key_..." },
  "public_key": "-----BEGIN PUBLIC KEY-----..."
}