Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 649
Product
FileManager
Title
Encryption Fails with FileManager
Problem
when calling the EncryptFile() method of FileManager, the following error may be received:
Error creating key container, access to the key container might be
denied: Object already exists.

This error results when the CryptAcquireContext API call can't get to the filesystem in order to create a key container.

Solution
1. Make sure the anonymous or authenticated user under which your application is running* has read permissions to the MachineKeys directory. It should be located here:

C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\Machinekeys

2. Make sure the anonymous or authenticated user* has rights to the specific key FileManager is trying to access. This is very similar to the first suggestion, except instead of giving rights to the entire MachineKeys folder, you are only giving it to one specific file inside that folder. There is a free program called ProcessMon from Sysinternals (now part of Microsoft) that will show you exactly what key your application is trying to access. Go here to download ProcessMon: http://technet.microsoft.com/en-us/sysinternals/bb896645

*By default, Classic ASP applications use the IUSR user account as the anonymous user. ASP.NET by default uses the ASPNET user account as the anonymous user, unless Impersonation is turned on. See here for more information on Impersonation in ASP.NET: http://msdn.microsoft.com/en-us/library/xh507fc5(vs.71).aspx.

Created : 12/31/2003 11:10:12 AM (last modified : 4/24/2012 4:12:17 PM)
Rate this article!
 
Comments