HpkeContext class final

An HPKE encryption context (RFC 9180 §5.2).

seal and open are ordered. Sequence n on the sender matches sequence n on the recipient. A failed open does not advance the sequence. export does not use the sequence.

dispose is best-effort zeroization of the context secrets. It is not a claim that the keys have left process memory.

Properties

hashCode → int
The hash code for this object.
no setterinherited
role → HpkeRole
Sender or recipient. The other direction's AEAD call fails.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
suite → HpkeSuite
Suite this context was scheduled with.
final

Methods

dispose() → void
Best-effort wipe of the key, base nonce, and exporter secret.
export(Uint8List exporterContext, int length) → Uint8List
RFC 9180 Context.Export. length is 1 .. 255 * Nh.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open(Uint8List ciphertext, {Uint8List? aad}) → Uint8List
Decrypts ciphertext (ciphertext || tag).
seal(Uint8List plaintext, {Uint8List? aad}) → Uint8List
Encrypts plaintext. Returns ciphertext || tag.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited