signWithECDSAKey method

ECDSASignature signWithECDSAKey(
  1. Uint8List m,
  2. SecureRandom secureRandom
)

Implementation

ECDSASignature signWithECDSAKey(Uint8List m, SecureRandom secureRandom) {
  ECDSASigner signer = ECDSASigner(Key.ellipticCurveHash(ecdsaKeyType));
  signer.init(
      true,
      ParametersWithRandom(
        PrivateKeyParameter(ecdsaPrivate),
        secureRandom,
      ));
  ECSignature sig = signer.generateSignature(m);
  return ECDSASignature(Key.name(ecdsaKeyType), sig.r, sig.s);
}