Skip to content

ChunkedEncryptOptions

Defined in: packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:25

Options for one chunked AES-256-GCM STREAM encryption using a direct CEK.

optional appMetadata?: AppMetadata

Defined in: packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:35

Authenticated application metadata carried without interpretation.


cek: Uint8Array

Defined in: packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:27

Exactly 32 bytes and not all-zero. The caller owns its lifecycle and reuse policy.


optional chunkSize?: number

Defined in: packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:30

Plaintext bytes per chunk. Defaults to DEFAULT_CHUNK_SIZE.


optional contentLength?: number

Defined in: packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:43

Exact plaintext length, if known up front. Stored in the authenticated plaintext_length header. Exceeding it fails the write; closing before reaching it fails the close. In either case, no final chunk is emitted and earlier output must be discarded. Omit if the length is not guaranteed.


optional contentType?: string | number

Defined in: packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:32


optional recipients?: readonly A256KWRecipient[]

Defined in: packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:49

Wrap the CEK for each recipient and write COSE_Encrypt (tag 96). Omit for COSE_Encrypt0 (tag 16); an empty array is rejected.