A rotated key must stop working everywhere it once worked
An API platform signs access tokens or service messages using a cryptographic key shared with several partner integrations. The engineering team issues a replacement key and updates the central service. One downstream verifier still trusts the old key because its local trust store was not refreshed. The old key can continue to validate messages in that part of the ecosystem, creating a gap between declared rotation and effective revocation. A key-rotation evidence pack should show the whole verification estate, not only a success message from the issuer.
Cryptographic key management differs from password rotation. The correct approach depends on whether the key signs tokens, encrypts stored data, protects transport, or authenticates a workload. Rotation, revocation and re-encryption have distinct effects. A replacement signing key can be introduced while old signatures remain valid for a bounded period; an encryption-key change may require controlled data migration. The acceptance plan must name the cryptographic function before making an assertion about completion.
Inventory issuers, verifiers and dependencies
List the key identifier, algorithm, owner, generation method, storage mechanism, authorised signing service, consuming applications, partner verifiers, cache behaviour and planned validity dates. Identify whether public verification material is distributed by JWKS, configuration package or manual certificate exchange. A partner’s local cache may ignore a removed public key until its refresh interval expires; document that exposure period and the agreed security consequence.
Determine who can generate, activate, export, disable and destroy key material. Use strong separation for signing privileges and avoid copying private keys into tickets or test logs. Where a hardware security module or cloud key service is used, verify actual usage permissions and audit evidence. “Key stored in KMS” does not establish that every privileged operator lacks the ability to misuse its signing operation.
Design the rollout without creating an outage
A routine rotation may use an overlap window in which both old and new verification keys are available while issuers begin signing with the new private key. Define exactly when new issuance switches, how long old tokens may remain valid and how to monitor partner readiness. For an emergency compromise, the risk may require revocation faster than the normal expiry period, with some disruption accepted. Document those distinct runbooks in advance.
Use test services and synthetic tokens to validate the sequence. First confirm an authorised token signed with the current key is accepted. Add the next verification key and switch new issuance. Verify tokens signed with the new key across all partner paths. After the approved overlap, remove the old verifier trust and demonstrate rejection at each test endpoint. A central metadata response showing no old key is not proof that every downstream cache stopped accepting it.
Test mismatched states deliberately
Exercise a verifier with stale configuration, a token referring to an unknown key ID, a valid signature using an expired key and a token with an altered audience or issuer. The expected result should be rejection under the agreed token policy. Ensure algorithm selection is constrained by policy rather than blindly trusted from an incoming token header. Avoid using real production private keys or generating exploitable messages against external partners outside the authorised test scope.
Test clock skew and overlapping validity periods. A partner server with an incorrect time can reject valid tokens or accept expired ones. Record expected tolerance and the monitoring used to detect excessive drift. Check availability when the key distribution endpoint is temporarily unreachable. The verifier should have an approved, bounded cache strategy rather than failing open to an arbitrary key.
Build evidence around the full key lifecycle
Preserve the approved rotation change, key IDs, owner approvals, cryptographic service audit events, partner acknowledgement, signed test-token fingerprints, actual verifier outcomes and revocation timestamp. Do not record secrets or full sensitive bearer tokens. The evidence should distinguish new-issuance success from old-key invalidation. Where an external partner cannot provide automated test results, obtain a documented validation record and a residual-risk decision with a deadline.
Review logs for repeated authentication failures following rotation. They may indicate misconfigured partners, malicious replay or legitimate clients using outdated credentials. A troubleshooting exception that simply restores old-key trust can defeat revocation; any temporary rollback needs a security owner and limited duration.
A partner-key rotation workbook
Consider an API issuer with three partner verifiers. Partner Alpha retrieves public signing keys dynamically from a documented JWKS endpoint. Partner Beta caches the key set for several hours. Partner Gamma distributes verifier configuration through a scheduled change process. Before rotating, capture which partner validates which token audiences, accepted algorithms, current key IDs and maximum key-cache intervals. Do not assume that publishing a new signing key automatically updates every verifier. A contractual integration may require the supplier to schedule the change even when the main issuer is ready immediately.
The security owner should distinguish two modes. Planned rotation can introduce a new key, issue new tokens and keep the retiring key in the published verifier set for a bounded overlap. Emergency compromise may require removing trust faster, despite breaking some tokens or integrations. Both plans need explicit risk, communication and rollback decisions. A fixed routine overlap period should not override the urgency of a credible private-key compromise.
Synthetic token checks
- Correct new signature: a token issued with the replacement key reaches the intended test API and is accepted with matching audience, issuer and expiry.
- Old token during overlap: a signed token using the retiring key behaves according to the approved transition schedule, rather than being accepted indefinitely.
- Old token after retirement: every configured test verifier rejects it, including a partner that previously cached trust material.
- Unknown key identifier: a token referencing an unrecognised key is denied; the verifier does not fetch trust from an arbitrary URL provided by the token.
- Wrong audience: a validly signed token for Service A cannot authorise Service B merely because both trust the same issuer.
Run these checks against non-production services and synthetic identities. Capture token fingerprints or metadata, not full reusable bearer tokens or private signing material.
Verification failure and rollback
Take the JWKS endpoint temporarily offline in a controlled simulation. Partner Alpha may continue working with an approved cached key set; it should not silently accept an unverified key or expand allowed algorithms. If clocks diverge, tokens may be rejected before or after their intended validity. Define bounded skew and monitor the partner configuration. When a critical partner fails the planned rotation, distinguish a safe, time-limited continuation of the overlap from a security-compromising restoration of an invalidated key.
A rollback that causes issuance to resume under the retired key should require a separate security approval, particularly after a suspected compromise. The team should know how to halt issuing, notify partners, remove a bad trust entry and restore service using a previously authorised safe path. Document what is feasible for each signing platform; not every key can be exported or reactivated once destroyed.
Evidence and operational sign-off
The issuer’s central dashboard is insufficient. Require partner-specific verifier results, exact key IDs, approved schedule, signing service audit events and evidence of old-key rejection after retirement. Record unresolved partners and any compensating network restrictions or limited token lifetimes. Where third-party verification cannot be tested directly, obtain a controlled partner attestation and identify the uncertainty. A completed rotation means the trust decision changed where tokens are actually accepted—not merely that the secret inventory contains a new row.
Partner escalation when a verifier stays stale
If Partner Beta still trusts the old signing key after the agreed overlap, the API owner should not quietly extend acceptance for everyone. Record the affected partner, token audience, remaining expiry, risk of old-key misuse and the operational effect of disconnecting the integration. A targeted control may allow a short exception for a known low-risk path, but a suspected signing-key compromise may make continued trust unacceptable. The decision belongs to the service and security owners with partner communication documented.
Confirm whether the apparent stale trust comes from a cache, duplicated JWKS configuration, clock skew or a completely separate verifier instance. Those defects need different repairs. A central test may not find a forgotten disaster recovery environment that still accepts old signatures. Sample secondary regions and failover endpoints before final sign-off.
Key custody and logging assurance
Review signing permissions, creation authority and audit protection. An operator who can request signatures for arbitrary token claims can sometimes misuse a key without exporting it. Distinguish custody of key material from authority to exercise the signing operation. Alerts should monitor unusual signing patterns, key-policy changes and failed verification attempts without storing full bearer tokens. The rotation evidence pack should allow later investigation without creating another repository of credentials.
Check partner onboarding against rotation rules
A new API partner may be integrated between scheduled key rotations. Its verifier must support the existing issuer, approved algorithms, cache refresh policy and planned retirement mechanism before production access is granted. Add a test for old-key rejection to the partner onboarding checklist, not only to the issuer’s annual key-management exercise. Where a partner uses a proprietary verification library, obtain its documented behaviour during cache expiry and key removal. A rotation process is fragile if every new integration adds an unmeasured delay or a private exception that the central team cannot discover.
For recurring assurance, keep a small partner verifier simulator that represents supported algorithms, cache behaviour and key retirement. Test it when a new signing library is introduced and after a partner changes authentication architecture. Capture which parts are simulated and which are confirmed by partner-side evidence. The goal is to expose a stale trust relationship early, before a real compromise demands emergency invalidation across dozens of external systems.
When can the rotation be called complete?
A normal planned rotation is complete when new tokens work, all required verifiers recognise the approved key, old verification paths have expired according to policy and no unsupported acceptance route remains. Emergency key compromise may require stronger evidence and faster invalidation. Assign owners for partners that cannot comply and document service impact. Rotation schedules should be revisited when new API consumers, certificate authorities, signing services or identity providers are added.
The key evidence pack is an operational control: it lets security and engineering prove what each verifier accepted at a point in time. Without that distributed view, the platform may rotate an identifier while retaining the exact trust relationship it intended to retire.
Sources and further reading
How Next Defence can help
Agree a safe validation covering rotating an API signing or decryption key while confirming both permitted and prohibited verifier behaviour, with key identifiers, overlap windows, accepted signatures and expiry observations available for review. Where a finding remains open, assign the decision to the business and technical owners. Next Defence’s Application Security & DevSecOps practice can support a scoped assessment.