469,273 Members | 1,760 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,273 developers. It's quick & easy.

CryptoAPI uniqueness

Hi
i have a question regarding the CryptoAPI.
I can seemingly call CryptAcquireContext, and if I pass any random string as
the key container name and NULL as the provider name, with CRYPT_NEWKEYSET
as the last parameter, then the rest of the crypt functions seem to work.
But I came across an instance when I stopped debugging the program, before I
had called CryptReleaseContext, and when I ran the program again, I got
FALSE returned, and !gle returned something like "The specified keyset
already exists". Presumably, the CSP can only service one unique "keyset" at
once, and if it is already "checked out", it can't service another request
for the same keyset name?
I want to write this in a DLL, and I would call CryptReleaseContext at the
end of the encrypting/decrypting method.
But what if more than one application was using the DLL at once, could
somebody confirm whether you're supposed to use a unique string for the
keyname for each application? What if two instances of the same application
were running at once and both doing cryptography at the same time?
(unlikely, but possible...)
Nov 17 '05 #1
0 941

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Puvendran Selvaratnam | last post: by
2 posts views Thread by Andy Atherton | last post: by
reply views Thread by Kim HM | last post: by
1 post views Thread by Greg Merideth | last post: by
reply views Thread by =?Utf-8?B?VmVuZWRpY3Q=?= | last post: by
1 post views Thread by MichaelAni | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.