Skip to content

decryptRangeWith

decryptRangeWith(source, unwrapper, range, options?): Promise<RangeResult>

Defined in: packages/filecoin-encryption-envelope/src/range/decrypt.ts:288

Like decryptRange, but recovers the CEK from the envelope’s recipients through unwrapper.

  • Tag 96 only: a tag-16 object fails with NoUsableRecipientError without calling unwrapper.
  • unwrapper is called once, with copies of every recipient in wire order, also when options.params skips the envelope read; its CEK is validated.
  • The range is planned first and the key recovered before the promise settles, so recipient failures reject it, never the stream.
ParameterType
sourceUint8Array<ArrayBufferLike> | RandomAccessSource
unwrapperUnwrapper
rangeByteRange
options?RangeDecryptOptions

Promise<RangeResult>