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

CryptAcquireContext problem

0 views
Skip to first unread message

Sergey Bogdanov

unread,
Jun 13, 2002, 7:34:00 PM6/13/02
to
I'm trying to call the function (CryptAcquireContext) to initialize the
cryptographic service provider in a COM object.

It works fine from Windows application, but I have a problem when I call
my method form ASP.NET (C#).
The hresult "ATL::CCryptProv::Initialize returned 0x80070002 The system
cannot find the file specified." retrurns by the class (it calls
CryptAcquireContext method inside Initialize).
What I did - I have copied the Default Crypto Provider dll everywhere -
in <localhost>\bin, c:\, <the project>\Debug. It doesn't help :(

Does anybody have any idea how to fix it?
Thanks!


Willy Denoyette [MVP]

unread,
Jun 15, 2002, 4:45:23 PM6/15/02
to
ASPNET account has no default key container (no interactive login no profile), you must use the machine key container.

See : CryptAcquireContext in msdn platform sdk.

<snippet

The CRYPT_MACHINE_KEYSET flag is useful when the user is accessing from a service or user account that did not log on interactively
When key containers are created, most CSPs do not automatically create any public/private key pairs. These keys must be created as a
separate step with the CryptGenKey function.

Willy.

"Sergey Bogdanov" <ser...@ascentis.com> wrote in message news:OJuI2KzECHA.968@tkmsftngp04...

0 new messages