Jump to content

  • Log In with Google      Sign In   
  • Create Account


Microsoft Authenticode / Code signing


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 DvDmanDT   Members   -  Reputation: 784

Like
0Likes
Like

Posted 29 March 2012 - 03:52 AM

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?

Sponsor:

#2 wack   Members   -  Reputation: 1226

Like
0Likes
Like

Posted 29 March 2012 - 12:18 PM

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.

#3 Telastyn   Crossbones+   -  Reputation: 3718

Like
-1Likes
Like

Posted 29 March 2012 - 01:35 PM

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)

#4 DvDmanDT   Members   -  Reputation: 784

Like
0Likes
Like

Posted 29 March 2012 - 01:45 PM

We use obfuscation from DotFuscator, so I assume I can't use the VS project setting..?

#5 wack   Members   -  Reputation: 1226

Like
1Likes
Like

Posted 29 March 2012 - 01:58 PM

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.

#6 Telastyn   Crossbones+   -  Reputation: 3718

Like
-1Likes
Like

Posted 29 March 2012 - 01:59 PM

Most likely no. I presume that the project setting just maps to a compiler flag; the basic idea should hold.

#7 Ectara   Crossbones+   -  Reputation: 2765

Like
0Likes
Like

Posted 31 March 2012 - 05:42 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS