Decrypt ciphertext by looking up the key version in the ring.
The key ring to search for the decryption key.
Base64-encoded ciphertext from encryptWithVersion.
The key version that was used to encrypt.
The decrypted plaintext string.
const plaintext = decryptWithVersion(ring, ciphertext, "v1"); Copy
const plaintext = decryptWithVersion(ring, ciphertext, "v1");
If the version is not found in the ring.
Decrypt ciphertext by looking up the key version in the ring.