Ed25519KeyPair class
A KeyPair implementation using the Ed25519 signature scheme.
This key pair supports signing and verifying data using Ed25519. It does not support any other signature schemes.
Constructors
- Ed25519KeyPair.fromPrivateKey(Uint8List privateKeyBytes, {String? id})
-
Creates a Ed25519KeyPair instance from a private key.
factory
- Ed25519KeyPair.fromSeed(Uint8List seed, {String? id})
-
Creates a Ed25519KeyPair instance from a seed.
factory
Properties
- defaultSignatureScheme → SignatureScheme
-
Returns the default signature scheme that is used if none is provided.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Wallet-internal identifier for this key pair.
final
- publicKey → PublicKey
-
Retrieves the public key.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
supportedSignatureSchemes
→ List<
SignatureScheme> -
Returns a list of SignatureSchemes supported by this key pair.
no setterinherited
Methods
-
computeEcdhSecret(
Uint8List publicKey) → Future< Uint8List> -
Computes the ECDH shared secret using the provided public key.
override
-
decrypt(
Uint8List ivAndBytes, {Uint8List? publicKey}) → Future< Uint8List> -
Decrypts the provided data using the public key.
override
-
ed25519KeyToX25519PublicKey(
) → Future< PublicKey> - Converts the Ed25519 key to an X25519 public key. Returns a Future that completes with the X25519 PublicKey.
-
encrypt(
Uint8List data, {Uint8List? publicKey}) → Future< Uint8List> -
Encrypts the provided data using the public key.
override
-
generateEphemeralPubKey(
) → List< int> - Generates a new ephemeral X25519 public key.
-
getSeed(
) → Uint8List - Returns the original seed used to derive the Ed25519 key pair.
-
internalSign(
Uint8List data, SignatureScheme signatureScheme) → Future< Uint8List> -
override
-
internalVerify(
Uint8List data, Uint8List signature, SignatureScheme signatureScheme) → Future< bool> -
Verifies a signature using Ed25519.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sign(
Uint8List data, {SignatureScheme? signatureScheme}) → Future< Uint8List> -
Signs the provided data using P-256 with SHA-256 hashing (ecdsa_p256_sha256).
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verify(
Uint8List data, Uint8List signature, {SignatureScheme? signatureScheme}) → Future< bool> -
Verifies a signature for the given
datausing the public key and optionally asignatureScheme.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
generate(
{String? id}) → (Ed25519KeyPair, Uint8List) -
Generates a new Ed25519 key pair.
Returns the KeyPair instance and its private key bytes.
id- Optional identifier for the key pair. If not provided, a random ID is generated.