private static bool VerifySignedData(byte[] signedData, byte[] originalData, byte[] publicKeyBlob)
{
if (null == signedData || 0 == signedData.Length)
{
throw new ArgumentNullException("signedData");
}
if (null == originalData || 0 == originalData.Length)
{
throw new ArgumentNullException("originalData");
}
if (null == publicKeyBlob || 0 == publicKeyBlob.Length)
{
throw new ArgumentNullException("publicKeyBlob");
}
using (RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider())
{
rsaProvider.ImportCspBlob(publicKeyBlob);
SHA256Managed sha = new SHA256Managed();
bool result = rsaProvider.VerifyData(originalData, sha, signedData);
sha.Dispose();
return result;
}
}
}