Skip to content

Class: SealedMessage ​

Defined in: envelope.ts:29

A sealed (encrypted) message: KEM ciphertext + AES-256-GCM ciphertext + metadata, serialized as CBOR identical to quantum-safe-py's SealedMessage.

Properties ​

aad ​

readonly aad: Uint8Array

Defined in: envelope.ts:41

The caller's additional authenticated data (empty by default).


algorithm ​

readonly algorithm: string

Defined in: envelope.ts:33

KEM algorithm the message was sealed to, e.g. X25519+ML-KEM-768.


ciphertext ​

readonly ciphertext: Uint8Array

Defined in: envelope.ts:39

AES-256-GCM ciphertext followed by the 16-byte tag.


kemCiphertext ​

readonly kemCiphertext: Uint8Array

Defined in: envelope.ts:35

The hybrid KEM ciphertext (HybridCipherText.to_bytes()).


nonce ​

readonly nonce: Uint8Array

Defined in: envelope.ts:37

12-byte AES-GCM nonce.


version ​

readonly version: number

Defined in: envelope.ts:31

Envelope format version (currently 1).

Methods ​

inspect() ​

inspect(): SealedInfo

Defined in: envelope.ts:98

Non-secret metadata.

Returns ​

SealedInfo


toBytes() ​

toBytes(): Uint8Array

Defined in: envelope.ts:90

CBOR serialization (copy).

Returns ​

Uint8Array


toHex() ​

toHex(): string

Defined in: envelope.ts:94

Lowercase hex of SealedMessage.toBytes.

Returns ​

string


toString() ​

toString(): string

Defined in: envelope.ts:101

Returns ​

string


fromBytes() ​

static fromBytes(data): SealedMessage

Defined in: envelope.ts:60

Parses CBOR bytes (from toBytes() or quantum-safe-py SealedMessage.to_bytes()).

Parameters ​

data ​

Uint8Array

Returns ​

SealedMessage


fromHex() ​

static fromHex(hex): SealedMessage

Defined in: envelope.ts:64

Parses a hex string produced by toHex() / quantum-safe-py to_hex().

Parameters ​

hex ​

string

Returns ​

SealedMessage


fromParts() ​

static fromParts(parts): SealedMessage

Defined in: envelope.ts:68

Assembles a sealed message from its fields (for example data stored in separate columns).

Parameters ​

parts ​
aad? ​

Uint8Array<ArrayBufferLike>

algorithm ​

string

ciphertext ​

Uint8Array

kemCiphertext ​

Uint8Array

nonce ​

Uint8Array

version? ​

number

Returns ​

SealedMessage

Apache-2.0.