# Unwrapper

> **Unwrapper** = (`recipients`, `signal?`) => [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) \| `undefined`\>

Defined in: [packages/filecoin-encryption-envelope/src/recipients/types.ts:61](https://github.com/FilOzone/synapse-sdk/blob/278badff6cfc813e6315d00c56f4a5f23c80f883/packages/filecoin-encryption-envelope/src/recipients/types.ts#L61)

Recover a CEK from an ordered, structurally validated recipient list.

Return `undefined` when none of the recipients can be handled. Throwing
aborts key recovery; `decryptWith`, `decryptRangeWith`, and
`aesGcm.decryptWith` report it as `RecipientUnwrapError` with the original
error as its cause, unless `signal` aborted.

Ownership: for a custom unwrapper, FEE borrows the returned key bytes only
long enough to import them into a non-extractable `CryptoKey` and never
zeroes or mutates the caller's buffer. The caller owns every key it returns,
including one FEE discards after cancellation (when `signal?.aborted`
becomes `true` before recovery settles and FEE skips validation and import),
and should zero it once the operation settles. When the built-in unwrapper
from `createA256KWUnwrapper` is passed directly, FEE zeroes its own
temporary unwrapped buffer after import or on abort/failure.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `recipients` | readonly [`RecipientInfo`](/reference/filecoin-encryption-envelope/namespaces/recipients/interfaces/recipientinfo/)[] |
| `signal?` | [`AbortSignal`](https://developer.mozilla.org/docs/Web/API/AbortSignal) |

## 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) \| `undefined`\>