Persits Software, Inc. Knowledge Base Articles

Error 800a0001 / Object already exists

Problem Description

When calling AspEncrypt's OpenContext or OpenContextEx methods, the following error is generated:

Persits.CryptoManager.1 error '800a0001'

The text message given with the error varies according to the version of Windows being used:

Windows NT 4 :
Keyset does not exist

Windows 2000 and XP :
Object already exists

Windows 2003 :
Access is denied
or :
An internal error occurred
or :
The handle is invalid

Solution

If a key container is not necessary for this operation, use containerless mode by passing an empty string as the container name, like this:

Set Context = CM.OpenContext("", True)

In general, a key container is only necessary for operations involving certificate-based encryption with public and private keys. A key container is not necessary for symmetric encryption or hashing operations.

If a key container is necessary, this error occurs due to the lack of permissions on your key containers. Key containers are stored in the system registry on Windows NT and in the file system on Windows 2000 and later.

Windows 2008, 7, 2012 and 8:

Change the permissions to the Machinekeys directory and the keys to allow the Everyone account to have full control. To do this, perform the following steps:

In Windows Explorer, right-click on the directory
\ProgramData\Microsoft\Crypto\RSA\MachineKeys

Note: These are hidden files and you may have to adjust Windows Explorer view settings to see them.

Click the Security tab and grant Everyone Full Control.

If the problem persists, try a different key container name.

Windows 2000 and 2003:

Change the permissions to the Machinekeys directory and the keys to allow the Everyone account to have full control. To do this, perform the following steps:

In Windows Explorer, right-click on the directory
\Documents and settings\All Users\Application Data\Microsoft\Crypto\RSA\Machinekeys

Note: These are hidden files and you may have to adjust Windows Explorer view settings to see them.

Click the Security tab and grant Everyone Full Control.

If the problem persists, try a different key container name.

Windows NT:

Run regedt32 (not regedit!), open the hive HKEY_LOCAL_MACHINE and highlight the key

HKEY_LOCAL_MACHINE\Software\Microsoft\ Cryptography\MachineKeys\<container name> .

Select Security/Permissions from the menu and grant "Everyone" Full Control over this registry key.

If the problem persists, try a different key container name.