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

CryptAcquireContext sharing between threads

246 views
Skip to first unread message

Christof Meerwald

unread,
Dec 30, 2009, 4:38:34 PM12/30/09
to
Hi,

I am just wondering if the HCRYPTPROV returned by CryptAcquireContext can be
shared by multiple threads (particularly for signing/verifying signatures).

I think the thing that confuses me a bit is the name "acquire context" which
somehow implies that there is some mutable state information held in the
returned object (which would mean that the returned handle can't be shared
by multiple threads) - but then "HCRYPTPROV" would sound more like it's just
a handle to a cryptography provider.

So can someone clarify if these objects can be shared by multiple threads
(without locking) or if each thread would need a separate handle.


Christof

--
http://cmeerw.org sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org

Stardust

unread,
Jan 22, 2010, 5:45:01 PM1/22/10
to
<from MSDN documentation>
"
Creation and deletion of the same key container across threads is not
supported. The CryptAcquireContext function is generally thread safe unless
CRYPT_NEWKEYSET or CRYPT_DELETEKEYSET is specified in the dwFlags parameter."

So what you need sounds thread safe.

"Christof Meerwald" wrote:

> .
>

0 new messages