newReceiver method

Receiver newReceiver({
  1. required Uint8List encapKey,
  2. required Uint8List domain,
})

Creates an HPKE receiver context for multi-message decryption using the encapsulated key from PublicKey.newSender.

Messages must be decrypted in the same order they were encrypted. X-Wing is used in HPKE's base mode, which does not authenticate the sender, so the context alone does not prove who sent the messages.

  • encapKey: The 1120-byte encapsulated key from PublicKey.newSender
  • domain: Application domain, the same as the sender's

Throws if encapKey is not 1120 bytes long or not a valid encapsulated key.

Implementation

Receiver newReceiver({
  required Uint8List encapKey,
  required Uint8List domain,
}) => Receiver._(_live.newReceiver(encapKey: encapKey, domain: domain));