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.


Tagged with: ,
Posted in General
5 comments 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. Anonymous says:

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

  3. games says:

    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 there i am kavin, its my first time to commenting anyplace, when i read this paragraph i thought i could also make comment due to this good post.

  5. 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

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow me
   RSS Feed    Twitter    Linked In

Write you email address to subscribe at this blog and to receive new posts by mail.

Join 611 other followers

Who I am?

%d bloggers like this: