verifyDerWithHashType static method
Verify a DER-encoded signature with a trailing sighash byte — the
format DOGE/LTC(non-Taproot)/BCH sign() actually produce. Returns
false for malformed DER instead of throwing.
Implementation
static bool verifyDerWithHashType(
String message, Uint8List publicKey, String signature) {
try {
final encoded = dynamicToUint8List(signature);
if (encoded.length < 9 || 2 + encoded[1] + 1 != encoded.length) {
return false;
}
final raw = derToRaw(encoded);
return verify(message, publicKey, dynamicToString(raw));
} catch (_) {
return false;
}
}