I'm trying to use Microsoft's Crypto API to do some RSA. On Windows Vista and above, my code runs without problem.
CryptAcquireContext(&m_hCryptProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, 0);
Unfortunately, on the two Windows XP machines that I have tried, I get error code NTE_BAD_KEYSET (0x80090016).
A little bit of googling found this article on Microsoft Support. http://support.microsoft.com/kb/238187
It mentions a CRYPT_VERIFYCONTEXT flag that can be passed if "you are not using a persisted private key that is stored in a key container". When does "persisted private key" mean in this context?
Since no one answered, my best guess is that a persisted private key is one that is put into a key store. I do not use the key store, and I don't know why, but XP required CRYPT_VERIFYCONTEXT and Vista+ do not.
User contributions licensed under CC BY-SA 3.0