Re: CryptAcquireContext fails with error (8009000F)
From: Sergio Dutra [MS] (sergio_at_online.microsoft.com)
Date: 05/11/04
- Next message: Eduard Koller [MSFT]: "Re: createPKCS10 error"
- Previous message: Sergio Dutra [MS]: "Re: Not able to import a personal certificate in IE browser"
- In reply to: sachin: "CryptAcquireContext fails with error (8009000F)"
- Next in thread: sachin: "Re: CryptAcquireContext fails with error (8009000F)"
- Reply: sachin: "Re: CryptAcquireContext fails with error (8009000F)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 11 May 2004 09:38:51 -0700
It usually means you already have that container name but it was not created
by you and you do not have permissions on it. Hence, when you try to acquire
a context without any keyset flags it will give you bad keyset, but when you
try to create the keyset CryptAcquireContext will return that it already
exists.
You will need to try a different key container name.
-- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "sachin" <mishraiisc@hotmail.com> wrote in message news:uagw$byNEHA.3380@TK2MSFTNGP11.phx.gbl... >I am running the following code on XP machines. On some of the machines it > gives error 8009000F at the place that I have marked in the code ###. > Error > description says "Object already exists." When does this error occur? > > LPCSTR UserName = "MyName"; > > if (RCRYPT_FAILED(CryptAcquireContext(&hCryptProv, UserName, > MS_ENHANCED_PROV, PROV_RSA_FULL, 0) ) ){ > if(GetLastError() == NTE_BAD_KEYSET){ > if (RCRYPT_FAILED(CryptAcquireContext(&hCryptProv, UserName, > MS_ENHANCED_PROV, > > PROV_RSA_FULL, CRYPT_NEWKEYSET) ) ){ > printf("Could not get crypto context %x",GetLastError() ); > #############ERROR########### > } > else{ > return TRUE; > } > } > } > else{ > return TRUE; > } > return FALSE; > > > > Thanks, > Sachin > >
- Next message: Eduard Koller [MSFT]: "Re: createPKCS10 error"
- Previous message: Sergio Dutra [MS]: "Re: Not able to import a personal certificate in IE browser"
- In reply to: sachin: "CryptAcquireContext fails with error (8009000F)"
- Next in thread: sachin: "Re: CryptAcquireContext fails with error (8009000F)"
- Reply: sachin: "Re: CryptAcquireContext fails with error (8009000F)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
Loading