سؤال

I'm trying to acquire the Microsoft Smart Card Key Storage Provider using:

CryptAcquireContext(&hProv, contName ,L"Microsoft Smart Card Key Storage Provider", PROV_RSA_FULL , flags);

but, this fails with error: NTE_KEYSET_NOT_DEF (0x80090019)

if I use:

CryptAcquireContext(&hProv, contName ,L" Microsoft Base Smart Card Crypto Provider", PROV_RSA_FULL , flags);

it works. But as far as my knowledge goes the Base Smart Card provider is the provider before CNG was introduced.

So what is the right Provider Name to use the CNG KSP for Smart Cards?

Thanks for your help!

هل كانت مفيدة؟

المحلول

The problem is that you don't use CryptAcquireContext for CNG providers. To open a CNG provider use NCryptOpenStorageProvider.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top