newKeyPair abstract method

Future<KeyPair> newKeyPair()

Generates a new KeyPair that can be used with this algorithm.

Example

In this example, we use X25519:

import 'package:cryptography/cryptography.dart';

Future<void> main() async {
  final algorithm = X25519();
  final keyPair = await algorithm.newKeyPair();
}

Implementation

Future<KeyPair> newKeyPair();