SecretKey class

An X-Wing private key for decrypting HPKE messages.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Wipes the secret key held in Rust memory. Every later use of this key throws a StateError, and disposing it again does nothing. Copies already exported, such as by toBytes, and receivers already created from it are not affected. Without a dispose, the key is only wiped if the garbage collector finalizes it, which is not guaranteed.
fingerprint() → Fingerprint
Returns a 256-bit unique identifier for this key. For HPKE, that is the SHA256 hash of the raw public key.
newReceiver({required Uint8List encapKey, required Uint8List domain}) → Receiver
Creates an HPKE receiver context for multi-message decryption using the encapsulated key from PublicKey.newSender.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open({required Uint8List sessionKey, required Uint8List msgToOpen, required Uint8List msgToAuth, required Uint8List domain}) → Uint8List
Consumes a standalone cryptographic construct encrypted to this secret key. The method will deconstruct the given encapsulated key and ciphertext and will also verify the authenticity of the (unencrypted) message-to-auth (not included in the ciphertext).
publicKey() → PublicKey
Retrieves the public counterpart of the secret key.
toBytes() → Uint8List
Converts a private key into a 32-byte seed.
toDer() → Uint8List
Serializes a private key into a DER buffer.
toPem() → String
Serializes a private key into a PEM string.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromBytes(Uint8List bytes) → SecretKey
Converts a 32-byte seed into a private key.
fromDer(Uint8List der) → SecretKey
Parses a DER buffer into a private key.
fromPem(String pem) → SecretKey
Parses a PEM string into a private key.
generate() → SecretKey
Creates a new, random private key.