Skip to content

Class: StreamSealer ​

Defined in: stream.ts:79

Low-level sealer: one object per stream. It owns the key and the chunk counter, so a nonce cannot be reused or skipped. Every chunk except the last must be exactly chunkSize bytes; the last may be shorter or empty. Free it (or use using) when done.

Implements ​

  • Disposable

Properties ​

chunkSize ​

readonly chunkSize: number

Defined in: stream.ts:83


readonly header: Uint8Array

Defined in: stream.ts:82

The header bytes to send first (the recipient needs them to open the stream).

Methods ​

[dispose]() ​

[dispose](): void

Defined in: stream.ts:106

Returns ​

void

Implementation of ​

Disposable.[dispose]


free() ​

free(): void

Defined in: stream.ts:103

Returns ​

void


seal() ​

seal(plaintext, last?): Uint8Array

Defined in: stream.ts:99

Seals the next chunk; pass last = true for the final one (exactly once). Returns the ciphertext (plaintext length + 16 bytes).

Parameters ​

plaintext ​

Uint8Array

last? ​

boolean = false

Returns ​

Uint8Array


start() ​

static start(publicKey, options?): StreamSealer

Defined in: stream.ts:91

Parameters ​

publicKey ​

PublicKey

options? ​

SealStreamOptions = {}

Returns ​

StreamSealer

Apache-2.0.