sign method

Uint8List sign(
  1. Uint8List data
)

Sign the provided data with the keypair's private key data.

Implementation

Uint8List sign(Uint8List data) {
  if (_mPrivateKey == null) {
    throw new Exception(
        "KeyPair does not contain secret key. Use KeyPair.fromSecretSeed method to create a new KeyPair with a secret key.");
  }

  ed25519.SigningKey sk = ed25519.SigningKey.fromValidBytes(_mPrivateKey!);
  ed25519.SignedMessage sm = sk.sign(data);
  return sm.signature.asTypedList;
}