CAPICOM support on Windows Vista
I know there has been a lot of confusion about this, because some articles on the web (i.e. MSDN) say CAPICOM is not supported on Vista, while others say it is.
I have good news for you people, especially for those who want to do cryptographic operations from scripting: CAPICOM is officially supported on Vista, but only on its version 2.1.0.2.
This version can be downloaded from here:
Platform SDK Redistributable: CAPICOM
https://www.microsoft.com/downloads/details.aspx?FamilyID=860ee43a-a843-462f-abb5-ff88ea5896f6&DisplayLang=en
(Note: at the time of this writing, this article DOES NOT say that CAPICOM is supported on Vista).
This new version of CAPICOM was released, among other reasons, because of a security update on CAPICOM:
Security Update for CAPICOM (KB931906)
https://www.microsoft.com/downloads/details.aspx?FamilyId=CA930018-4A66-4DA6-A6C5-206DF13AF316&displaylang=en
(Note: this article DOES say that CAPICOM is supported on Vista)
If we try to use version 2.1.0.1 on Vista, for instance, a small .NET sample which uses CAPICOM like the following:
"
StoreClass store = new StoreClass();
store.Open(CAPICOM_STORE_LOCATION.CAPICOM_SMART_CARD_USER_STORE, null, CAPICOM_STORE_OPEN_MODE.CAPICOM_STORE_OPEN_READ_WRITE);
"
Will return the following exception:
"
System.Runtime.InteropServices.COMException (0x80880900): Exception from HRESULT: 0x80880900
"
Which means:
"
# for hex 0x80880900 / decimal -2138568448
CAPICOM_E_NOT_SUPPORTED capicom.h
"
Anyway, my recommendation is to use .NET Framework classes instead of CAPICOM whenever possible.
I hope this helps.
Cheers,
Alex (Alejandro Campos Magencio)