# decryptWith

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

Defined in: [packages/filecoin-encryption-envelope/src/aes-gcm.ts:182](https://github.com/FilOzone/synapse-sdk/blob/e853a1d93da8c983371ffce4424cdb8996cc06ff/packages/filecoin-encryption-envelope/src/aes-gcm.ts#L182)

Authenticate and decrypt a complete scheme-1 FEE object, recovering its CEK
from a recipient via `unwrapper`.

Accepts only `COSE_Encrypt` (tag 96); a tag-16 envelope carries no
recipients and fails with `NoUsableRecipientError` without calling
`unwrapper`. Borrows `encoded`: callers must not modify it until the
returned promise settles. Each recipient is copied into an isolated
`RecipientInfo` before reaching `unwrapper`, so the caller's `encoded` bytes
are unaffected by anything the unwrapper does to what it receives.
`unwrapper` is called at most once, with every recipient in wire order; its
resolved CEK is validated as an exactly 32-byte, non-zero key before use.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `encoded` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) |
| `unwrapper` | [`Unwrapper`](/reference/filoz/filecoin-encryption-envelope/namespaces/recipients/type-aliases/unwrapper/) |

## Returns

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