Hi Team,
We are using ComponentPro.Saml dll to generate the SAML response XML. While signing it with SHA256 algorithm we are getting below error
**Assembly: ComponentPro.Saml, Version=7.2.40.234**
**Code**
assertion.Sign(idpCert, "http://www.w3.org/2001/04/xmlenc#sha256", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256");
**Error:**
Inner Exception: Invalid Alogorithm Specified
Stack Strace:
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.Utils.SignValue(SafeKeyHandle hKey, Int32 keyNumber, Int32 calgKey, Int32 calgHash, Byte[] hash, Int32 cbHash, ObjectHandleOnStack retSignature)
at System.Security.Cryptography.Utils.SignValue(SafeKeyHandle hKey, Int32 keyNumber, Int32 calgKey, Int32 calgHash, Byte[] hash)
at System.Security.Cryptography.RSACryptoServiceProvider.SignHash(Byte[] rgbHash, Int32 calgHash)
at ComponentPro.Saml.PrefixSignedXml.ComputeSignature()
at ComponentPro.Saml.SamlUtil.ComputeSignature(XmlElement xmlElement, String elementId, AsymmetricAlgorithm signingKey, KeyInfo keyInfo, PrefixSignedXml signedXml, String inclusiveNamespacesPrefixList, String digestMethod, String signatureMethod)
However **assertion.Sign(idpCert)** works fine. Not sure issue is with our .pfx file or any configuration is missing in my code.
Please suggest.
asked 2/16/2021 3:29:13 PM