"Invalid provider type specified" error when accessing X509Certificate2.PrivateKey on CNG certificates

Hi all,  You may get the following exception when trying to access X509Certificate2.PrivateKey on a .NET 3.5 (or older) app: “System.Security.Cryptography.CryptographicException: Invalid provider type specified. at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()” When this happened to me,…

7

Does SignTool work on Windows 7?

Hi all, The answer to the question of the title is YES, OF COURSE! Why wouldn’t it? Well, the reason of this question is the following: you may already know that CAPICOM has been deprecated on Windows 7 (CAPICOM support on Windows 7). It was going to be deprecated when Vista came out, but it didn’t…

0

x64 version of SignTool?

Hi all, I was asked the other day if we had an x64 version of SignTool.exe. Up to date, the answer is NO. If you download the tool with Microsoft Windows SDK, you will only get the x86 version. This tool has dependencies on some x86 authenticode plug-ins, and as you sure know, you cannot load…

2

x64 version of CAPICOM?

Hi all, Now that we are progressively moving to x64 systems, many people ask me if there is an x64 version of CAPICOM available. The answer is no, there is not. And because CAPICOM is already deprecated (CAPICOM support on Windows 7), there won’t ever be any. So if you are using a version of…

5

2.1.0.3, a new CAPICOM version?

Hi all, The other day I got surprised when a customer of mine told me that they had seen a new CAPICOM version being installed by Office 2007 SP2: 2.1.0.3. I’ve been dealing with many CAPICOM issues in the past, and I had no news of such a version. Is it a new version? Can…

2

HttpWebClientProtocol.ClientCertificates and PFX files

Hi all, Imagine you want to call a webservice through SSL in a client application. You want to provide a client certificate to the SSL connection and you have a PFX file with that client certificate plus the CA certificate plus the root certificate. None of those certificates are installed in the system. So you…

1