# decryptWith

> **decryptWith**(`unwrapper`, `options?`): `ReadableWritablePair`\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>, [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\>

Defined in: [packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:679](https://github.com/FilOzone/synapse-sdk/blob/3eddbd10de185cd5351f9dfc8401ed48284e19a3/packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts#L679)

Decrypt a scheme-2 object using a CEK recovered by `unwrapper`.

For tag 96, the unwrapper is called once with isolated copies of all
recipients in wire order and an `AbortSignal` that aborts if the stream is
cancelled, aborted (including via `options.signal`), or fails (but not on
successful EOF). A tag-16 object has no recipients and fails without calling
it. The returned CEK is validated before any chunk is decrypted. When
`options.signal` aborts, both sides of the returned pair error with the exact
`signal.reason`, pending writes are unblocked, and any late key result is
discarded without importing it. As with `decrypt`, discard plaintext already
read if the stream fails.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `unwrapper` | [`Unwrapper`](/reference/filecoin-encryption-envelope/namespaces/recipients/type-aliases/unwrapper/) |
| `options?` | [`DecryptOptions`](/reference/filecoin-encryption-envelope/interfaces/decryptoptions/) |

## Returns

`ReadableWritablePair`\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>, [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\>