decrypt
decrypt(
input,ciphertext):string
Defined in: packages/core/src/utils/encrypt.ts:59
Decrypt a value produced by encrypt, trying the current key first and then the previous one (the rotation fallback).
Parameters
Section titled “Parameters”Server secret, or the current/previous pair during a rotation.
ciphertext
Section titled “ciphertext”string
Encrypted payload in iv:tag:ciphertext (base64url) format.
Returns
Section titled “Returns”string
The original plaintext secret.
Throws
Section titled “Throws”If no secret is configured, the payload is malformed, or no key decrypts it.