If you're get one of the following exception messages in your application:

Message: Keyset does not exist

StackTrace:   
  
   at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
   at System.Security.Cryptography.SafeProvHandle._FreeCSP(IntPtr pProvCtx)
   at System.Security.Cryptography.SafeProvHandle.ReleaseHandle()
   at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
   at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
   at System.Runtime.InteropServices.SafeHandle.Finalize()

 

Message: Access is denied.

StackTrace:  

   at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
   at System.Security.Cryptography.Utils._CreateCSP(CspParameters param, Boolean randomKeyContainer, SafeProvHandle& hProv)
   at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
   at System.Security.Cryptography.RSACryptoServiceProvider.ImportParameters(RSAParameters parameters)
   at System.Security.Cryptography.RSA.FromXmlString(String xmlString)

 Solution:

The application might be trying to write to the following folder path: C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys

If your application is using impersonation or using the IUSR_MACHINENAME user, then configure the MachineKeys folder sercurities and give the user Read & Execute, List Folder Contents, Read, Write.  If that doesn't work, try giving the Everyone user the same permissions.

相关文章:

  • 2021-06-13
  • 2022-12-23
  • 2021-08-13
  • 2021-05-29
  • 2021-09-22
  • 2022-12-23
  • 2021-11-25
  • 2021-07-28
猜你喜欢
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2021-07-13
  • 2021-08-02
  • 2021-09-06
  • 2021-06-03
相关资源
相似解决方案