2018-02-19

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.

Capture

5 thoughts on “How to sign an assembly in Visual Studio, from a validated certificate (Verisign, Globasign)

  1. Pretty nice post. I simply stumbled upon your weblog and wanted to
    mention that I have really enjoyed surfing around your weblog posts.

    In any case I will be subscribing in your rss feed and I hope you write again very soon!

  2. This site was… how do you say it? Relevant!! Finally I’ve found something that
    helped me. Many thanks!

  3. I just like the valuable information you provide to
    your articles. I will bookmark your blog and take a look at once more here frequently.
    I am somewhat certain I’ll be informed many new
    stuff proper here! Best of luck for the next!

  4. Hi Your site loads up honestly slow to me, I am not sure who’s issue
    is that however facebook starts extremely fast. Around the other hand thank you
    for publishing lovely blog post. I think it really has already been incredibly beneficial to
    individual who click here. I hope I’ll be able
    to find more remarkable information and I should really complement you by stating you’ve done remarkable writing.

    To get additional knowledge through content that you write-up,
    I’ve saved this page.

Leave a Reply

Your email address will not be published. Required fields are marked *