System. Security. cryptography. cryptographicexception: keyset does not exist or access is denied.

Source: Internet
Author: User
If you're getting 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 ents 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.