generateKey function

KeyPair generateKey()

GenerateKey generates a public/private key pair using entropy from secure random.

Implementation

KeyPair generateKey() {
  var seed = Uint8List(32);
  fillBytesWithSecureRandomNumbers(seed);
  var privateKey = newKeyFromSeed(seed);
  var publicKey = privateKey.bytes.sublist(32, PrivateKeySize);
  return KeyPair(privateKey, PublicKey(publicKey));
}