keySignature method
Implementation
Uint8List keySignature(Uint8List signContent, ECPrivateKey privateKey) {
var secureRandom = getSecureRandom();
final signer = ECDSASigner()
..init(
true,
ParametersWithRandom(
PrivateKeyParameter(privateKey),
secureRandom,
),
);
var signature = signer.generateSignature(signContent) as ECSignature;
final encodedSignature = ASN1Sequence(elements: [
ASN1Integer(signature.r),
ASN1Integer(signature.s),
]).encode();
return encodedSignature;
}