Decrypt
Source:
src/Fly/Decrypt.ts
Decrypt with a Fly SecretKey. The App and key name are fixed
by Decrypt(key).
Decrypt a payload
Section titled “Decrypt a payload”Provide DecryptHttp. Plaintext comes back Redacted. Unwrap
with Redacted.value only where you need the raw bytes.
import * as Redacted from "effect/Redacted";
const decrypt = yield* Fly.Decrypt(Box);const { plaintext } = yield* decrypt({ ciphertext });const bytes = Redacted.value(plaintext);Associated data
Section titled “Associated data”associatedData must match the bytes passed to Encrypt.
const { plaintext } = yield* decrypt({ ciphertext, associatedData: nonce,});