generate static method

PrivateKey? generate(
  1. String algorithm
)

Generate a new private key for the specified algorithm.

Creates a cryptographically secure random private key.

Returns null if the algorithm is unsupported.

Implementation

static PrivateKey? generate(String algorithm) {
  final helper = sharedCryptoExtensions.privateHelper;
  return helper!.generatePrivateKey(algorithm);
}