Skip to content

decryptRangeWith

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

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

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 (and options.signal when provided), 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.
  • When options.signal aborts during setup or streaming, setup rejects or stream errors with the exact signal.reason, active or late source streams are cancelled, and any late key result is discarded without import.
Parameter Type
source Uint8Array<ArrayBufferLike> | RandomAccessSource
unwrapper Unwrapper
range ByteRange
options? RangeDecryptOptions

Promise<RangeResult>