I am facing issues on signature verification by using string. The following code always returns false. Kindly help me outor suggest some implementation.....
thanks in advance
string
idpSigningCert = "Certificate string copied from OIF metadata";
byte[] certData = Encoding.Default.GetBytes(idpSigningCert);
X509Certificate2
cert = new X509Certificate2(certData);
RSACryptoServiceProvider csp = (RSACryptoServiceProvider)cert.PublicKey.Key;
SHA1Managed sha1 = new SHA1Managed();
UnicodeEncoding encoding = new UnicodeEncoding();
string text = "SamlResponse from Querystring";
string base64signature ="Response signature from querystring";
byte[] hash = sha1.ComputeHash(text);
// Verify the signature with the hash
isSignatureVerified = csp.VerifyHash(hash,
CryptoConfig.MapNameToOID("SHA1"), Convert.FromBase64String(base64signature));