Le CAPICOM e Windows 7

Ogni nuova release di Sistema Operativo porta con sè diverse novità, tra tecnologie vecchie che scompaiono di scena, e nuove entrate.

CAPICOM, la libreria wrapper COM per le Crypto API, esce di scena e non è più supportata a partire da Windows 7.

Il link uffciale su MSDN, http://msdn.microsoft.com/en-us/library/aa375754(VS.85).aspx, indica i sistemi operativi su cui l’ultima versione di quella libreria è supportata: “CAPICOM 2.1.0.2 is available for use in the following operating systems: Windows Server 2008, Windows Vista, Windows XP, and Windows 2000.” Niente Windows 7 quindi, a meno di ripensamenti futuri (conoscete tutti la formula “Due to popular demand..” Wink )..

La stessa pagina contiene il link alle alternative .Net da usare su Windows 7 e sistemi successivi: http://msdn.microsoft.com/en-us/library/cc778518(VS.85).aspx

Le alternative sono praticamente incluse nelle classi:
System.Security.Cryptography,
System.Security.Cryptography.Pkcs,
System.Security.Cryptography.X509Certificates e
System.Security.Cryptography.Xml

*******Breaking News!!!*******
Potrebbe sembrare a prima vista che la SP2 di Office 2007 installi una nuova versione di CAPICOM: 2.1.0.3.
In realtà il team di sviluppo ci ha confermato che per fare fronte ad un problema del programma di setup di Office 2007 si è dovuto cambiare il numero di versione della CAPICOM.DLL. NON ESISTE UNA NUOVA VERSIONE!! E' solo un workaround per un problema del setup di Office 2007.

 

Esistono anche delle estensioni alle su riportate classi, disponibili come codice “Open Source” sotto il nome di CLR Security

Security.Cryptography.dll provides a new set of algorithm implementations to augment the built in .NET framework supported algorithms. It also provides some APIs to extend the existing framework cryptography APIs. Within this project you will find:

  • A CNG implementation of the AES, RSA, HMACSHA2, and TripleDES encryption algorithms
  • A CNG implementation of a random number generator
  • A CNG implementation of authenticated symmetric encryption.
  • A class that allows dynamically creating algorithms both from this library as well as all of the algorithms that ship with .NET 3.5
  • An enumerator over all of the installed CNG providers on the current machine
  • Extension methods that allow access to all of the keys installed in a CNG provider, as well as all of the algorithms the provider supports
  • Extension methods to access X509Certificates that store their key with CNG, as well as create self signed X509Certificates.
  • Other utility types and methods

Per esempi e dettagli sulle CryptoAPI vi rimando al blog del mio collega Alejandro Campos Magencio, Decrypt my World.

Alla prossima!

Mario Raccagni
Senior Support Engineer
Platform Development Support Team