generateRsaKeyPair function

Future<KeyPair> generateRsaKeyPair({
  1. int bits = 2048,
})

Generate a new RSA key pair with the specified number of bits

Implementation

Future<p2pkeys.KeyPair> generateRsaKeyPair({int bits = 2048}) async {
  if (bits < minRsaKeyBits) {
    throw RsaKeyTooSmallException();
  }
  if (bits > maxRsaKeyBits) {
    throw RsaKeyTooBigException();
  }

  return await generateRSAKeyPair(bits: bits);
}