Signature Generation Error

I am trying to integrate the ComponentSpace system into our web application so that we can handle SAML SSO scenarios with our clients.

I have the SAML v2.0 for .NET4 package downloaded and installed. I can use the sample project files to go between the sdp and idp whether it be MVC or Web Forms and have it work just fine. I’ve now configured my system to use the test project Web Forms idp. I’m now configuring our web application locally as the sdp using Web Forms. I’ve followed the documentation and believe everything is setup.

My problem rests somewhere with the certificate generation. I’m using the provided idp certificate from the example project file, but am generating my own certificate for the sdp side of things (yes I’m loading it into both the example project as well as our own web application project). This is the error I get when going from the idp to our own sdp:

System.Web.HttpUnhandledException (0x80004005): Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> ComponentSpace.SAML2.Exceptions.SAMLSignatureException: Failed to generate signature —> System.Security.Cryptography.CryptographicException: Invalid algorithm specified.

From some searching it appears to be something with SHA-256 and certificate generation. I’ve looked through the documentation, but am unclear the direction to take as there are 10 different ways provided in the instructions and I am not sure what direction I should be taking.

Please point me in the right direction.

The most likely cause is that your private key specifies a cryptographic service provider (CSP) that doesn’t support SHA-256.
The following forum post explains how you can use openssl to confirm this and update the PFX file to specify the correct CSP.
http://www.componentspace.com/Forums/1578/SHA256-and-Converting-the-Cryptographic-Service-Provider-Type

[quote]
ComponentSpace - 1/23/2017
The most likely cause is that your private key specifies a cryptographic service provider (CSP) that doesn't support SHA-256.
The following forum post explains how you can use openssl to confirm this and update the PFX file to specify the correct CSP.
http://www.componentspace.com/Forums/1578/SHA256-and-Converting-the-Cryptographic-Service-Provider-Type
[/quote]

Great thanks, I'll give that a shot.

You’re welcome.

[quote]
ComponentSpace - 1/23/2017
You're welcome.
[/quote]

Thanks again, the post you specified cleared up my certificate errors.

You’re welcome. Thanks for the update.