CryptoProvider class abstract interface

Generates keys and signs and verifies strings - the Dart counterpart of the JavaScript SDK's ICryptoProvider.

The handlers (KeyHandler, TransactionHandler, PayloadHandler) take one of these and default to DefaultCryptoProvider. Supply your own to sign somewhere else - an HSM, a secure enclave - without touching anything else.

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

generate({KeyType type = KeyType.secp256k1, bool compressed = false}) → KeyMaterial
A fresh key of type. compressed applies to secp256k1 only.
generateFromSeed(Uint8List seed, {KeyType type = KeyType.secp256k1, bool compressed = false}) → KeyMaterial
The key determined by the algorithm's own seed: 32 bytes for secp256k1 and ml-dsa-65, 48 for falcon-512. No KDF is applied, and a wrong length is refused - never padded or truncated into a different identity.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign(String data, String privateKey, {KeyType type = KeyType.secp256k1}) → String
Signs the UTF-8 bytes of data and returns the signature as base64, ready for $sigs.
toString() → String
A string representation of this object.
inherited
verify(String data, String signature, String publicKey, {KeyType type = KeyType.secp256k1}) → bool
Verifies a base64 signature over the UTF-8 bytes of data. Returns false, never throws, for a malformed signature or key.

Operators

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