randomSecp256k1KeyPair function

AsymmetricKeyPair<PublicKey, PrivateKey> randomSecp256k1KeyPair()

Generates a random secp256k1 key pair.

Implementation

AsymmetricKeyPair randomSecp256k1KeyPair() {
  var keyParams = ECKeyGeneratorParameters(ecParams);

  var random = FortunaRandom();
  random.seed(KeyParameter(_seed()));

  var generator = ECKeyGenerator();
  generator.init(ParametersWithRandom(keyParams, random));

  return generator.generateKeyPair();
}