I'm trying to verify the signature of bytes but having trouble getting it to work. I've also tried signing the bytes myself (with this algorithm) and verifying it myself, but the result keeps coming back as false
Verifier:
bool verifyCert(Certificate fristCert, Certificate secondCert) {
ECPoint publicKeyPoint = ECCurve_secp256r1().curve.decodePoint([0x04, ...firstCert.publicKey])!;
ECPublicKey ecPublicKey = ECPublicKey(publicKeyPoint, ECCurve_secp256r1());
ECDSASigner verifier = ECDSASigner(SHA256Digest());
verifier.init(false, PublicKeyParameter<ECPublicKey>(ecPublicKey));
final r = BigInt.from(secondCert.signature.sublist(0, 32).buffer.asByteData().getUint64(0));
final s = BigInt.from(secondCert.signature.sublist(32).buffer.asByteData().getUint64(0));
final certSig = ECSignature(r,s);
return verifier.verifySignature(secondCert.digest, certSig);
}
Please ignore any typos (if any) and Certificate is just a class that determines which bytes pertain to what part of the Certificate.
Hello,
I'm trying to verify the signature of bytes but having trouble getting it to work. I've also tried signing the bytes myself (with this algorithm) and verifying it myself, but the result keeps coming back as
false
Verifier:
Please ignore any typos (if any) and Certificate is just a class that determines which bytes pertain to what part of the Certificate.