Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CryptAcquireContext failing inexplicably

2 views
Skip to first unread message

Paul Forgey

unread,
Jul 14, 1998, 3:00:00 AM7/14/98
to
I'm having the following work fine on some machines, and failing with
GetLastError() == 0x80090016 (NTE_BAD_KEYSET).

if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0))
return FALSE;

Uhh... this is the default cypher installed on NT 4.0 with the Crypto API is
it not?? I'm worried about the viability of our software using this if some
machines just simply fail to bring it up for unknown reasons.

Both machines (the one working and not working ) are NT 4.0 SP3 Server.

Any ideas?


Samuel R. Blackburn

unread,
Jul 14, 1998, 3:00:00 AM7/14/98
to
I ran into this when I was writing C++ classes to encapsulate the API.
There isn't a keyset created for the user when you call AcquireContext.
You need to create a new keyset using CRYPT_NEWKEYSET as the
last parameter. After the keyset is created (should happen only once
per user), you can get a handle to the crypto provider.

HTH,

Sam
http://ourworld.compuserve.com/homepages/sam_blackburn

Paul Forgey wrote in message
<#tJXtN0r...@uppssnewspub05.moswest.msn.net>...

0 new messages