newKeyPair static method
Implementation
static Future<KeyPair> newKeyPair() async {
final algorithm = c.X25519();
final keyPair = await algorithm.newKeyPair();
final publicKey = await keyPair.extractPublicKey();
final secretKey = await keyPair.extractPrivateKeyBytes();
return KeyPair(
pk: hex.encode(publicKey.bytes),
sk: hex.encode(secretKey),
);
}