eVC++ smart card CryptAcquireContext error NTE_BAD_KEYSET
I am trying to write a program using eVC++ 4.0 for Pocket PC 2003 that uses the windows cryptography functions. The smart card is inserted into a smart card reader in a pocket pc expansion pack.
I have succeeded in using the smart card resource manager(winscard.dll) functions to connect and establish a context with the smart card. However I have tried calling CryptAcquireContext to acquire a handle to a particular key container on the smart card as shown below but I keep getting the error NTE_BAD_KEYSET. pszContainer is set to NULL for the default name.
CryptAcquireContext(&hCryptProv, pszContainer, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET | CRYPT_SILENT))
the thing is I dont know if CryptAcquireContext is trying to connect to a key container on the smart card or the Pocket PC. Has anyone done this before? I know it is possible and on msdn at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnscard/html/smartcardcspcook.asp
it says that CryptAcquireContext can be used for connecting to the key container on the smart card, but they dont state how.
How do I use CryptAcquireContext to get a handle for the key container on the smart card? Any help would be very appreciated thanks! If you have any questions feel free to ask them.
regards
zhuang

