CryptAcquireContext - Object already exists Error
From: Carmit (carmitm_at_mail.com)
Date: 09/23/04
- Next message: Phil Ten: "CryptAcquireContext fails with error 6 (The handle is invalid)"
- Previous message: RelyKY: "How to export Ceritificate and Private Key as a PFX file?"
- Next in thread: Ryan Menezes [MSFT]: "Re: CryptAcquireContext - Object already exists Error"
- Reply: Ryan Menezes [MSFT]: "Re: CryptAcquireContext - Object already exists Error"
- Reply: lelteto: "RE: CryptAcquireContext - Object already exists Error"
- Reply: Daniel Sie [MSFT]: "Re: CryptAcquireContext - Object already exists Error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 23 Sep 2004 02:22:05 -0700
Hi,
I'm trying to use Crypto API in a COM object.
Here is some of my code:
if(!CryptAcquireContext(&hCryptProv, password, NULL, PROV_RSA_FULL,
CRYPT_MACHINE_KEYSET))
{
//need to create a new key container
if(!CryptAcquireContext(&hCryptProv, password, NULL, PROV_RSA_FULL,
CRYPT_NEWKEYSET | CRYPT_MACHINE_KEYSET ))
{
hr = E_FAIL;
...
return hr;
}
}
}
When trying to use my COM object from an ASP web page everything is
great, but when I'm trying to use it from another application (let's
say a VB application), I get an error that my key container already
exists.
I understood that using CRYPT_MACHINE_KEYSET flag should allow me to
use this key container from different applications on the same
machine.
Any help would be appriciated.
Thanks,
Carmit
- Next message: Phil Ten: "CryptAcquireContext fails with error 6 (The handle is invalid)"
- Previous message: RelyKY: "How to export Ceritificate and Private Key as a PFX file?"
- Next in thread: Ryan Menezes [MSFT]: "Re: CryptAcquireContext - Object already exists Error"
- Reply: Ryan Menezes [MSFT]: "Re: CryptAcquireContext - Object already exists Error"
- Reply: lelteto: "RE: CryptAcquireContext - Object already exists Error"
- Reply: Daniel Sie [MSFT]: "Re: CryptAcquireContext - Object already exists Error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|