Geeks With Blogs
Saqib Ullah BootStrapper Know How

This issue is related to permission on MachineKeys folder. I think this is right place where you should know what the determination of MachineKeys folder is.

What is MachineKeys Folder?

 

The MachineKeys folder stores certificate pair keys for both the computer and users. Both Certificate services and Internet Explorer use this folder. 

Possible reasons for getting this error message in your application are, may be your application using a certificate or your application trying to access a private key.

There are two ways through which you can solve this error.

First Way (When you don’t know the certificate key)

Open this folder C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys


Fig 1: MachineKeys Folder is protected and showing lock sign.

Give “Read and Write” and “List Folder Contents” permissions in Security tab to the IIS worker processes impersonated account (IUSER_MachineName or Network Service or any other account) to below folder

Fig 2: Giving Rights to MachineKeys Folder.


Fig 3: MachineKeys folder is granted for IIS worker processes impersonated account and lock sign has gone.

Second Way (When you certificate key)

Open mmc from Start menu. Add certificates snap-In and open the respective certificate store folder and then follow the step.

“Certificate Name” -> (Right-click) -> All Tasks -> Manage private keys

Add the IIS worker processes impersonated account (IUSER_MachineName or Network Service or any other account).


Fig 4: Certificate Manage private keys property.

Posted on Wednesday, October 12, 2011 6:56 AM Exceptions , .Net , General , Security | Back to top


Comments on this post: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
it is very good example.

lots of Thanks
Left by amit jain on Apr 18, 2012 1:04 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
Spot on, exactly what I needed,
thanks
Left by Niall Hines on Jun 07, 2012 9:12 PM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
What if the exception occurs the second day? If I generate a certificate for say 10 days, the first day I have no problems, but the next day I get this exception.
Above solution didn't work.
Left by Eric on Nov 21, 2012 1:20 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
Isn't the first option basically a no go? I mean, give Read/*Write* permissions to the whole *Folder" to the *IIS User*? I would have to ask why use certificates if you configure the system to be almost wide open...
Left by Pedro Ferreira on Nov 22, 2012 5:39 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
This worked well with my Security issues. It works better now, thanks
Left by Annette on Feb 24, 2013 6:39 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
My security issues are fixed now. Thanks for your help on this.
Left by Janina on Apr 14, 2013 7:42 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
Excellent post....this helped resolve the issue.
Thanks for your help
Left by Vgera on May 07, 2013 6:12 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
thanks the article helped resolve the issue.

Thanks
Left by pola naeem on Dec 18, 2013 9:01 PM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
This post give me the right direction in order to solve the issue we were facing. However, one note I'd like to add is in order to give permissions for an account you prior have to take ownership of that folder as I'd faced "Access denied" errors.
Left by Fernando on May 29, 2014 5:24 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
You are a rockstar and savior. This solved my issue.
Left by C# Dev on Jun 12, 2014 10:36 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
You're a lifesaver. this article resolved our issue!
Left by Cliff on Feb 11, 2015 11:01 PM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
you are my hero! I've been troubleshooting for 2 evenings in a row - this finally resolved the issue. Thank you!!
Left by Crystal Delgado on Oct 06, 2015 2:02 PM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
Thanks! We spent hours trying to solve this error, and the MachineKeys permissions solved it!
Left by Dan on Dec 03, 2015 10:27 AM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
Above Solution didn't work .....
Left by keertik nagda on Jul 17, 2016 10:34 PM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
The above solution didn't work for me.. :(
Is there any other solution?
Left by Amruta on Feb 01, 2017 10:51 PM

# re: System.Security.Cryptography.CryptographicException: Keyset does not exist or Access is denied issue.
Requesting Gravatar...
We can include the IIS pool user and give the permissions which is much safer wayout.
Left by Surendra Lal on Nov 20, 2017 7:45 PM

Your comment:
 (will show your gravatar)


Copyright © Saqib Ullah | Powered by: GeeksWithBlogs.net