Skip to content
PlatformMarkdown

Revoke a signing key

Destroy a signing key version so nothing it signed verifies again, in the right order when a key is exposed.

API

You believe a signing key has leaked, or you’re retiring old keys after a rotation. Revoking a version destroys it in the key store: it leaves the published key set, and every token it signed stops verifying. Users holding such tokens sign in again, or their apps refresh.

Before you start: you need the MODIFY right on the realm’s keySettings. The key that is signing now can’t be revoked, so if it’s the one you distrust, you’ll rotate first. It’s done through the API, with your session in $CVYUH_SESSION: Call the API shows how to get it.

  1. Find the version. Call GET https://foobar.cvyuh.com/api/v0/am/keys/v1. Each signing key version is an entry whose key is oauth2/signing, with its version, alg, state and validFrom. The one signing now for an algorithm is the valid entry with the latest validFrom already past.

  2. If it’s the key signing now, rotate that algorithm to a new key, with validFrom as soon as the publish lead allows, and wait until the new key has been signing for a minute (rotation.skewSecs).

  3. Revoke the version:

    Terminal window
    curl -X DELETE https://foobar.cvyuh.com/api/v0/am/keys/v1/signing/<version> \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

    The realm answers 204.

Call GET https://foobar.cvyuh.com/api/v0/am/keys/v1 again: a revoked version is destroyed, so it is no longer listed. Its kid is gone from https://foobar.cvyuh.com/oauth2/jwks.

  • 400. The version is signing now, or started within rotation.skewSecs (60 seconds by default). Rotate, wait until the new key has signed for longer than that, and revoke again.
  • 404. No such version, or it’s already revoked. List the keys and check the number.
  • 403. Your rights don’t include MODIFY on keySettings.

Each revocation is recorded on the realm’s audit trail as a DELETED record for the key version, under your name: see Signing keys.

A revocation can’t be undone: the key is destroyed. Tokens it signed can’t be made to verify again; their users sign in again.