XCBPrivateKey.createPrivateKey constructor

XCBPrivateKey.createPrivateKey(
  1. String seed,
  2. int index
)

Creates a new, random private key from the random number generator.

For security reasons, it is very important that the random generator used is cryptographically secure. The private key could be reconstructed by someone else otherwise. Just using Random() is a very bad idea! At least use Random.secure().

Implementation

factory XCBPrivateKey.createPrivateKey(String seed, int index) {
  final key = generateNewPrivateKey(seed, index);
  return XCBPrivateKey(key);
}