How to sign an assembly in Visual Studio, from a validated certificate (Verisign, Globasign)
If, like me, you want sign your assembly from Visual Studio, you received probablely an error message like “Cannot import the following key file … The key file may be password protected”.
First, read an excellent article about Differences between certificate signing and strong naming (from Eric Lippert).
Next, use this procedure to transform your Code Certificate purchased from Verisign or Globasign to a valid certificate for Visual Studio Strong Name.
1. Download OpenSSL from this site. 2. Execute the following commands to export to a key file usable by Visual Studio.
openssl pkcs12 -in GlobalSignCodeCertificate.pfx -out BackupCertFile.key openssl pkcs12 -export -out CertFileToSignWith.pfx -keysig -in BackupCertFile.key
3. Then in the project properties of Visual Studio, you can use the PFX file.