I get this error while trying to set up a DSACryptoServiceProvider to be used for a DSA Signature on a HSM that accepts DSA Signature :
"The specified cryptographic service provider (CSP) does not support this key algorithm."
Call stack :
at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle) at System.Security.Cryptography.DSACryptoServiceProvider.GetKeyPair() at ProjektDemoHSM.Controller.setDSAAlgo(Dictionary`2 listProp) in Controller.cs:line 788
Code :
CSP = new CspParameters(1, "Luna Cryptographic Services for Microsoft Windows");
l.788 : DSAcsp = new DSACryptoServiceProvider(CSP);
And I am sure the CSP
accepts DSA
as : (I spared you the whole list of supported algorithms)
c:\Program Files\SafeNet\LunaClient\KSP>certutil -csp "Luna Cryptographic Services for Microsoft Windows" -csptest
Signature Algorithms:
DSA
Asymmetric Algorithms:
DSA
CertUtil: -csptest command completed successfully.
If anyone had any idea what could cause such an error, I am interessed. FYI, I am running on .NET 3.5
, and trying to use an HSM Luna SA. I have no problem using RSACryptoServiceProvider
or ECDsaCng
, but ``DSA just won't work. Thanks in advance!