A vault rotates the JWT signing key every 30 days. After each rotation, APIs reject unexpired tokens signed with the previous key. What should the engineer change?
Show the answer
Correct answerA. Publish the old public key beside the new one until old tokens expire
AWhy this is right: Keeping the old verification key available during an overlap lets in-flight tokens validate while new ones use the new key.
BWhy not this: Rotating only after compromise abandons scheduled rotation and does not fix validation of in-flight tokens.
CWhy not this: Longer lifetimes widen the window of tokens signed by the old key and weaken the security gain.
DWhy not this: TLS certificates secure transport and are unrelated to which key verifies token signatures.
Rotation needs an overlap period: the new key signs new tokens while the old public key stays available to validate tokens already issued. Lengthening token lifetimes makes the overlap problem longer and weakens the benefit of rotation.