Pergunta

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!

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top