ecdsaVerifyDer method
Implementation
Future<bool> ecdsaVerifyDer({
required String namedCurve,
required String hashAlgorithm,
required Uint8List spkiPublicKey,
required Uint8List data,
required Uint8List derSignature,
}) async {
final firstTry = await _crypto.ecdsaVerify(
namedCurve: namedCurve,
hashAlgorithm: hashAlgorithm,
spkiPublicKey: spkiPublicKey,
data: data,
signature: derSignature,
);
if (firstTry) return true;
try {
final raw = ecdsaDerToRaw(derSignature, namedCurve: namedCurve);
return _crypto.ecdsaVerify(
namedCurve: namedCurve,
hashAlgorithm: hashAlgorithm,
spkiPublicKey: spkiPublicKey,
data: data,
signature: raw,
);
} catch (_) {
return false;
}
}