Failed to generate the XML signature - Invalid algorithm specified

I have updated ComponentSpace library 2.6.0.7 → 3.1. I also updated target framework 4.6.1 to 4.7.1

This is the only change which started throw exception in this line
SAMLMessageSignature.Generate(samlResponseXml, cert.PrivateKey, cert);

Message: ComponentSpace.SAML2.Exceptions.SAMLSignatureException : Failed to generate the XML signature.
----> System.Security.Cryptography.CryptographicException : Invalid algorithm specified.

Same certificate is used.

What is wrong?




In later releases we switched the default signature algorithm from SHA-1 to SHA-256.
We still support SHA-1 but recommend using SHA-256.
The most likely cause of the exception you’re seeing is that the cryptographic service provider (CSP) associated with your private key doesn’t support SHA-2.
The following forum post explains how to check this and use openssl to update your PFX file.
https://www.componentspace.com/Forums/1578/SHA256-and-Converting-the-Cryptographic-Service-Provider-Type
If there’s still an issue, please enable SAML trace and send the generated log file as an email attachment to support@componentspace.com.
https://www.componentspace.com/Forums/17/Enabing-SAML-Trace

Hi,

Has this been resolved? We are also getting the same issue but our difference with alexey.korsakov case is that we did not update ComponentSpace library version. We just updated to .Net 4.7.2 from .Net 4.6.2.
Any clue why this issue is happening? Same issue will happen if upgrading to .Net 4.7.1 but will be OK with .Net 4.7.

I hope you can provide some resolution.

Thanks,
Earl

[quote]
earl - 10/18/2019
Hi,

Has this been resolved? We are also getting the same issue but our difference with alexey.korsakov case is that we did not update ComponentSpace library version. We just updated to .Net 4.7.2 from .Net 4.6.2.
Any clue why this issue is happening? Same issue will happen if upgrading to .Net 4.7.1 but will be OK with .Net 4.7.

I hope you can provide some resolution.

Thanks,
Earl
[/quote]

By the way, version is 2.6.0.13
[quote]
earl - 10/18/2019
Hi,

Has this been resolved? We are also getting the same issue but our difference with alexey.korsakov case is that we did not update ComponentSpace library version. We just updated to .Net 4.7.2 from .Net 4.6.2.
Any clue why this issue is happening? Same issue will happen if upgrading to .Net 4.7.1 but will be OK with .Net 4.7.

I hope you can provide some resolution.

Thanks,
Earl
[/quote]

By the way, version is 2.6.0.13[/quote]
Just found out that this is an issue with Cryptographic Service Provider of certificate not supporting SHA-256.

Thanks for the update.