SecretKey class

An ML-DSA-65 private key paired with an Ed25519 private key for creating and verifying quantum resistant digital signatures.

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, 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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publicKey() → PublicKey
Retrieves the public counterpart of the secret key.
sign(Uint8List message) → Signature
Creates a digital signature of the message.
toBytes() → Uint8List
Converts a secret key into its 64-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
Creates a private key from a 64-byte seed, the ML-DSA-65 seed (32 bytes) followed by the Ed25519 seed (32 bytes).
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.