verify method
Verifies the signature.
Implementation
@override
Future<bool> verify(List<int> data, {required Signature signature}) async {
if (usePlugin) {
try {
final rsaSecretKey = signature.publicKey as RsaPublicKey;
final result = await channel.invokeMethod(
'rsa_pss_verify',
{
'data': Uint8List.fromList(data),
'e': Uint8List.fromList(rsaSecretKey.e),
'n': Uint8List.fromList(rsaSecretKey.n),
},
);
if (result is! Map) {
throw StateError('Invalid output from plugin: $result');
}
return result['result'] as bool;
} catch (error) {
usePlugin = false;
}
}
return super.verify(data, signature: signature);
}