X509Certificate2 raises "The Smart card resource manager is not running" exception

Hi all, Some time ago a customer of mine was getting a CryptographicException with message “The Smart card resource manager is not running” when using X509Certificate2 object in a Windows service. This was the call stack at the point of exception:   at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)    at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer,…

2

SCardEstablishContext fails with SCARD_E_NO_SERVICE error

Hi all, If you call SCardEstablishContext API in a Windows service running under a specific user account (domain\user) or NETWORK SERVICE, you may get the following error on Vista/Server 2008 or Windows 7/Server 2008 R2: 0x8010001d – SCARD_E_NO_SERVICE – “The Smart card resource manager is not running.”. If the service runs as SYSTEM, the same…

3