[prev in list] [next in list] [prev in thread] [next in thread]
List: ms-cryptoapi
Subject: Re: NTE_BAD_KEYSET error
From: "Peter Chrapchynski, P.Eng." <chrapchp () BGA ! COM>
Date: 1998-03-25 18:46:36
[Download RAW message or body]
If you are using the sample and don't have a default key container then this
call will fail. You must call
CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,
CRYPT_NEWKEYSET). You can substitute a conatiner name in place of the NULL.
Otherwise the current user’s logon name is used.
pjc
-----Original Message-----
From: Kaynam Hedayat <Kaynam_Hedayat@PICTEL.COM>
To: CryptoAPI@DISCUSS.MICROSOFT.COM <CryptoAPI@DISCUSS.MICROSOFT.COM>
Date: Wednesday, March 25, 1998 12:07 PM
Subject: NTE_BAD_KEYSET error
>Hi,
>
>I am trying one of the sample codes and the call to CryptAcquireContext()
>fails withe the NTE_BAD_KEYSET error. I have Win/NT WS 4.0 (SP3). The
>CryptoAPI reference states that "The registry entry for the key container
>could not be opened and may not exist". I am not sure what this means. Am
>I missing something on the system? The code segment is shown below.
>
> // Get handle to the default provider.
> if(!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_SIG, 0)) {
> printf("Error %x during CryptAcquireContext!\n", GetLastError());
> goto done;
> }
>
>
>Thanks.
>
>
>Kaynam
>
>----------------------------------------------------------------
>Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
>contains important info including how to unsubscribe. Save time, search
>the archives at http://microsoft.ease.lsoft.com/archives/index.html
>
----------------------------------------------------------------
Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
contains important info including how to unsubscribe. Save time, search
the archives at http://microsoft.ease.lsoft.com/archives/index.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic