Ed25519PrivateKey constructor

Ed25519PrivateKey(
  1. HexInput hexInput, [
  2. bool? strict
])

Create a new PrivateKey instance from a Uint8List or String.

Read about AIP-80

hexInput is a HexInput (string or bytes). If strict is true, the private key must be AIP-80 compliant.

Implementation

Ed25519PrivateKey(HexInput hexInput, [bool? strict])
    : _signingKey = PrivateKey.parseHexInput(
          hexInput, PrivateKeyVariants.ed25519, strict) {
  if (_signingKey.toUint8List().length != Ed25519PrivateKey.length) {
    throw ArgumentError(
      'PrivateKey length should be ${Ed25519PrivateKey.length}',
    );
  }
}