extractSeed method

Future<Uint8List> extractSeed(
  1. SimpleKeyPair keyPair
)

Extracts the private key seed (32 bytes) from a key pair.

Security Note: The caller is responsible for zeroing the returned bytes after use. Use CryptoUtils.zeroMemory.

Implementation

Future<Uint8List> extractSeed(SimpleKeyPair keyPair) async {
  final privateKey = await keyPair.extractPrivateKeyBytes();
  // Ed25519 private key is 32-byte seed
  return Uint8List.fromList(privateKey.sublist(0, 32));
}