What is delay signing?

Answer Posted / johncena

During development process you will need strong name keys to
be exposed to developer which
is not a good practice from security aspect point of view.In
such situations you can assign the key
later on and during development you an use delay signing
Following is process to delay sign an assembly:
√ First obtain your string name keys using SN.EXE.
√ Annotate the source code for the assembly with two custom
attributes from
System.Reflection: AssemblyKeyFileAttribute, which passes
the name of the file
containing the public key as a parameter to its constructor.
AssemblyDelaySignAttribute,
which indicates that delay signing, is being used by passing
true as a parameter to its
constructor. For example as shown below:
[Visual Basic]
<Assembly:AssemblyKeyFileAttribute("myKey.snk")>
<Assembly:AssemblyDelaySignAttribute(true)>
[C#]
[assembly:AssemblyKeyFileAttribute("myKey.snk")]
[assembly:AssemblyDelaySignAttribute(true)]
The compiler inserts the public key into the assembly
manifest and reserves space in the PE file for
the full strong name signature. The real public key must be
stored while the assembly is built so
that other assemblies that reference this assembly can
obtain the key to store in their own assembly
reference.
&#8730; Because the assembly does not have a valid strong name
signature, the verification of
that signature must be turned off. You can do this by using
the –Vr option with the
Strong Name tool.The following example turns off
verification for an assembly called
myAssembly.dll.
Sn –Vr myAssembly.dll

&#8730; Just before shipping, you submit the assembly to your
organization's signing authority
for the actual strong name signing using the –R option with
the Strong Name tool.
The following example signs an assembly called
myAssembly.dll with a strong name
using the sgKey.snk key pair.
Sn -R myAssembly.dll sgKey.snk

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you configure a .net remoting object via xml file?

770


What is fundamental of published or precreated objects in remoting?

772


What are different types of assemblies?

757


Explain Singleton design pattern of Remoting?

731


What do you mean by passport authentication?

719


What are the steps to publish an object outside the service domain

717


Can you explain remoting?

769


What are the ways to configure remoting objects before client can use them?

811


What are the different types of channels used by .net remoting and which is the best one?

714


What are the threading types?

720


What are the security features in .net remoting?

735


Explain the hierarchial description of remoting?

693


What does manifest consists?

698


How to directly call a native function exported from a dll?

744


Explain the differences between marshal by value and marshal by reference?

774