generateKeypair method

AsymmetricKeyPair<PublicKey, PrivateKey> generateKeypair([
  1. SecureRandom? random
])

Implementation

AsymmetricKeyPair<PublicKey, PrivateKey> generateKeypair([SecureRandom? random]) {
  random ??= getRandom();
  CipherParameters cipherParams = ECKeyGeneratorParameters(_ecDomainParams);
  cipherParams = ParametersWithRandom(cipherParams, random);

  final generator = ECKeyGenerator()..init(cipherParams);
  final keypair = generator.generateKeyPair();
  return keypair;
}