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
NoUsableRecipientErrorwithout callingunwrapper. unwrapperis called once, with copies of every recipient in wire order (andoptions.signalwhen provided), also whenoptions.paramsskips 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.signalaborts during setup or streaming, setup rejects orstreamerrors with the exactsignal.reason, active or late source streams are cancelled, and any late key result is discarded without import.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
Uint8Array<ArrayBufferLike> | RandomAccessSource |
unwrapper |
Unwrapper |
range |
ByteRange |
options? |
RangeDecryptOptions |