Rotate the key ring — the current key moves to previous and newKey becomes the current encryption key.
previous
newKey
The existing key ring.
The new key to activate.
A new key ring with the rotated keys.
ring = rotateKey(ring, { version: "v2", key: "bb".repeat(32), activatedAt: new Date() }); Copy
ring = rotateKey(ring, { version: "v2", key: "bb".repeat(32), activatedAt: new Date() });
Rotate the key ring — the current key moves to
previousandnewKeybecomes the current encryption key.