Skip to content

createA256KWUnwrapper

createA256KWUnwrapper(keys, options?): Promise<Unwrapper>

Defined in: packages/filecoin-encryption-envelope/src/recipients/a256kw.ts:149

Build an 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 CryptoKeys and copied kids, so callers may clear their KEK bytes. Duplicate keys are allowed and are tried in the order given.

ParameterType
keysreadonly A256KWKey[]
options?A256KWUnwrapperOptions

Promise<Unwrapper>