SIGN UP MEMBER LOGIN:    
ARTICLE

Delay Signing an Assembly

Posted by Sushmita Kumari Articles | C# Assemblies January 18, 2006
In this article we will elaborate the terminology Delay Signing as well as what it means. How it works and the approach to achieve it.
Reader Level:

Introduction:-

When we talk about the Assembly then the first thing comes into our mind is the security for high level development. Delayed signing is the terminology when we are certifying the assembly which will prevent hi-jacking of that assembly.

Delayed signing refers to a technique of partially signing assemblies while they are in development phase. So, signing an assembly basically certifies that assembly by the manufacturer and prevents tampering and hi-jacking of that assembly. This is achievable by using public key/private key encoding of parts of the assembly. The public key is embedded in the assembly and will be used by third-parties who want to reference the assembly. There are many more benefits to signing an assembly, but the main purpose of delayed signing is to allow a company to protect and control its private key and only use it during the packaging process. A delayed signed assembly can still be used like a signed assembly, you just can't package and ship it.

Steps to certify the Assembly:-

Delays sign a .NET app:

sn -k keypair.snk

  1. sn -p keypair.snk public.snk
  2. Build assembly with:
    [assembly: AssemblyDelaySign("false")]
    [assembly: AssemblyKeyFile("..\\..\\keypair.snk")]
  3. sn -Vr AssemblyName.dll
  4. This step is critical and is not mentioned anywhere. Exit and restart every instance of VisualStudio running. Until you do this Visual Studio will not know of the sn -Vr from step 4 and you will get
    "COM Interop registration failed. The check of the signature failed for assembly AssemblyName.dll"

Login to add your contents and source code to this article
share this article :
post comment
 

In the article u have mentoned [assembly: AssemblyDelaySign("false")] but, When you only have access to the key file that contains just the public key, you must enable delay signing of the assembly. Therefore, instead of the above attributes, you need to specify the following attributes. [assembly: AssemblyDelaySign(true)]

Posted by John Apr 02, 2009

Dear Sushmita, Let me take a copy form your example.. sn -p keypair.snk public.snk Build assembly with: [assembly: AssemblyDelaySign("false")] [assembly: AssemblyKeyFile("..\\..\\keypair.snk")] But where the generated public key file (public.snk) is used. To my understanding first we can sign the assembly with the public.snk [assembly: AssemblyDelaySign("false")] [assembly: AssemblyKeyFile("..\\..\\public.snk")] Then we can skip the signature verification using sn -Vr AssemblyName.dll Then during deployment, we can sign the assembly with the original key file ie, keypair.snk Pls give your valuable inputs

Posted by shams venkitta Nov 24, 2007

ver very good

Posted by basam sreenivas Nov 01, 2007

Very good stuff

 

Bharath Reddy VasiReddy

Posted by Bharath Reddy VasiReddy Jun 14, 2007

Hi

very nice your article

 

PrasathVV

Posted by venkatesa Feb 21, 2006
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Become a Sponsor