Skip to content

Function: sealBytes() ​

sealBytes(publicKey, data, options?): Promise<Uint8Array<ArrayBufferLike>>

Defined in: stream.ts:447

Convenience: encrypts a whole buffer. Returns the complete encrypted stream as one array.

Parameters ​

publicKey ​

PublicKey

The recipient's hybrid KEM key or ML-KEM-1024 key.

data ​

Uint8Array

The plaintext.

options? ​

SealStreamOptions = {}

aad and chunkSize (see SealStreamOptions).

Returns ​

Promise<Uint8Array<ArrayBufferLike>>

The encrypted stream (prelude and frames) in one array.

Throws ​

for a key that is not a hybrid KEM key or ML-KEM-1024.

Throws ​

for a chunkSize outside 1,024 to 16,777,216 or a data that is not bytes.

Apache-2.0.