verifyRSASignature function

bool verifyRSASignature(
  1. RSAKey publicKey,
  2. RSASignature signature,
  3. Uint8List message
)

Verifies RSA signature on message with private key matching publicKey.

Implementation

bool verifyRSASignature(
    RSAKey publicKey, RSASignature signature, Uint8List message) {
  RSASigner signer = RSASigner(SHA1Digest(), '06052b0e03021a');
  signer.init(
      false,
      ParametersWithRandom(
          PublicKeyParameter<asymmetric.RSAPublicKey>(
              asymmetric.RSAPublicKey(publicKey.n, publicKey.e)),
          null));
  return signer.verifySignature(
      message, asymmetric.RSASignature(signature.sig));
}