Skip to content

ChunkedEncryptOptions

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

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:54

Authenticated application metadata carried without interpretation.


cek: Uint8Array

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

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:49

Plaintext bytes per chunk. Defaults to DEFAULT_CHUNK_SIZE.


optional contentLength?: number

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

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:51


optional recipients?: readonly A256KWRecipient[]

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

Recipients for CEK wrapping. When present, produces COSE_Encrypt (tag 96); when omitted, produces COSE_Encrypt0 (tag 16). An empty array is invalid.