verifyECDSASignature function
bool
verifyECDSASignature(
- int keyType,
- ECDSAKey publicKey,
- ECDSASignature signature,
- Uint8List message,
Verifies ECDSA signature
on message
with private key matching publicKey
.
Implementation
bool verifyECDSASignature(int keyType, ECDSAKey publicKey,
ECDSASignature signature, Uint8List message) {
ECDSASigner signer = ECDSASigner(Key.ellipticCurveHash(keyType));
ECDomainParameters curve = Key.ellipticCurve(keyType);
signer.init(
false,
PublicKeyParameter(
ECPublicKey(curve.curve.decodePoint(publicKey.q), curve)));
return signer.verifySignature(message, ECSignature(signature.r, signature.s));
}