Jump to content
  • Advertisement
Sign in to follow this  

Microsoft Authenticode / Code signing

This topic is 2242 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!

For work, we are looking at signing our executables so that they can be verified and don't generate warnings for our users. Does anyone have experience with this? Our application is written in C# and uses the .NET 4 Client Profile framework. From what I understand, this code signing technique is called Authenticode..? Is that also the tech used so sign .NET assemblies?

I also understand that I need a certificate for this signing to really mean something. The first provider (CA that is) we found was Verisign.com, which is well known and therefore seemed like a good choice. However, it talks about ActiveX controls and appears to lock the key files to a specific system.. Does anyone know how that works? How do I use it once I have a certificate?

Share this post


Link to post
Share on other sites
Advertisement
This is what is used for signing both native and .NET exes/dll files: http://msdn.microsoft.com/en-us/library/8s9b9yaz(v=vs.80).aspx

Unfortunately I am not too sure how the actual certificate is obtained, or what kind of certificate you should ask them for. But I do know that it can be obtained From Verisign, but that we switched to someone else I can't remember, because it cost less.

I do know things about signatures from a technical perspective, so if you have specific questions, just ask.

I can share one curious thing I have found out that made me scratch my head for a while, before I realized what was going on:
The application was on a machine without connection to the internet. It froze for (i think) 60 seconds when launched. And only when the files were signed...

It turns out that counter-signed (signed with timestamp) .NET-assemblies attempt to validate the signature online when loaded. To avoid this, they can be signed without timestamp. Native DLLs do not exhibit this behaviour, even if signed with timestamp.

Setup files (exe, msi, cab) should be signed with timestamp. They work fine in all current versions of Windows without it, but Windows 8 seems to treat them as "unknown publiher" if they are not signed with timestamp.

Share this post


Link to post
Share on other sites

Does anyone know how that works? How do I use it once I have a certificate?


Once you have a cert, you should be able to generate a key for code signing from it. Don't know specifically how that works; should just be an export option.

Signing code can be done in the properties for the project. There's a signing tab, then you just need to specify the strong name key file (.snk). If you're using click once, that uses a different type of cert (.pfx)

Share this post


Link to post
Share on other sites
Remember that it can cause confusion that there are two different ways (that are completely unrelated) to sign assemblies. Using an snk file in the project options is called "strong name assemblies". This has nothing to do with the level of trust placed in the assembly, it's just a way of making sure the assembly "name" is unique. This is not what you want, if I understand your request properly.

If you want digital signatures with trust (and from your first post I gather that you do), you need to use a certificate obtained from someone like Verisign and use it with the tool linked in my previous post.

Share this post


Link to post
Share on other sites
If anyone can sign their own applications from within the IDE through a compiler flag, may whatever deity save the poor soul that puts trust in signed applications.

It sounds like you need a certificate from an authority like Verisign.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!