# createA256KWUnwrapper

> **createA256KWUnwrapper**(`keys`, `options?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Unwrapper`](/reference/filoz/filecoin-encryption-envelope/namespaces/recipients/type-aliases/unwrapper/)\>

Defined in: [packages/filecoin-encryption-envelope/src/recipients/a256kw.ts:149](https://github.com/FilOzone/synapse-sdk/blob/e853a1d93da8c983371ffce4424cdb8996cc06ff/packages/filecoin-encryption-envelope/src/recipients/a256kw.ts#L149)

Build an [Unwrapper](/reference/filoz/filecoin-encryption-envelope/namespaces/recipients/type-aliases/unwrapper/) that recovers a CEK from A256KW recipients using
a fixed set of caller-held KEKs. Intended to be passed to
`aesGcm.decryptWith`, which supplies decoded, validated recipients; the
returned function trusts its input and performs no validation of its own.

Every KEK is imported once, sequentially, while this factory's promise is
pending; once it settles the unwrapper holds only `CryptoKey`s and copied
kids, so callers may clear their KEK bytes. Duplicate keys are allowed and
are tried in the order given.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `keys` | readonly [`A256KWKey`](/reference/filoz/filecoin-encryption-envelope/namespaces/recipients/interfaces/a256kwkey/)[] |
| `options?` | [`A256KWUnwrapperOptions`](/reference/filoz/filecoin-encryption-envelope/namespaces/recipients/interfaces/a256kwunwrapperoptions/) |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Unwrapper`](/reference/filoz/filecoin-encryption-envelope/namespaces/recipients/type-aliases/unwrapper/)\>