Microsoft.Protocols.TestSuites.MS_WOPI.RSACryptoContext.VerifySignedData C# (CSharp) Method

VerifySignedData() private static method

A method is used to validate the signed data by using specified public key.
private static VerifySignedData ( byte signedData, byte originalData, byte publicKeyBlob ) : bool
signedData byte A parameter represents the signed data which will be validate.
originalData byte A parameter represents the original data which is used to execute the validation.
publicKeyBlob byte A parameter represents the binaries data of the public key part of a unique key-pairs.
return bool
        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;
            }
        }
    }