What is delay sign in .net

Posted by Srinup97 under .NET Framework on 9/4/2013 | Points: 10 | Views : 1984 | Status : [Member] | Replies : 2
Hi

What is delay sign in .net and where it is used in .net
Tell me with examples

srinivasp


Responses

Posted by: Allemahesh on: 9/4/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Dear Srinivas,

Delay signing is a technique for signing assemblies outside of the build process. The idea here is, your company might have policies that don't allow the strong name keys from being available at build time (perhaps they are kept offline, or secured behind a password.) A delay signed assembly is marked with a blank strong-name key: it basically reserves space for the key to be added later, by an authorized user. In the mean time, a partial strong-name key is included -- just enough information for other assemblies to make a strong reference, but not enough to detect changes or modifications.
Delayed signing is used when the author of the assembly does not have access to the private key that will be used to generate the signature

Happy Coding.


Srinup97, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 9/4/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Dear Srinivas,

When we create a strong named assembly and want this assembly to be used by someone else, we partially build this assembly by provide a Public Key. We write this Public Key in the AssemblyInfo.vb OR .cs file using the attribute

<Assembly:AssemblyKeyFileAttribute("somekey.snk")>


Note here that somekey.snk is a key that you create using sn.exe tool.

We create it like this in the command line compiler

sn.exe -k "c:\somekey.snk"


Note that we also turn off the verification of the assembly (the DLL) using the sn tool like this...

sn -Vr assemblyName.dll
where -Vr is an option.

Once created, we add it to the assemblyinfo file.

We also add an attribute by the named <Assembly:AssemblyDelaySignAttribute(true)> to the assembly info file. This makes it sure that when we build the assembly, It would be containing the information only about the public key before we deliver it to our client or whosoever needs it.

Remember that this is a partial strong named assembly that we have created, and hence we say that it is a Delayed Assembly.

In this process, the public key is inserted into the assembly manisfest, which ultimately reserves some space for the Full Strong Named Assembly in the Portable Executable (PE) file.
In the end, while giving the key to your client, they may use the following command to convert the Delayed Assembly to a Full Strong Named Assembly

sn -R assemblyname.dll strongKey.snk 
where strongKey.snk is a strongly named key.

You can use the below link:
http://www.c-sharpcorner.com/UploadFile/sushmita_kumari/DelaySigning101182006025505AM/DelaySigning1.aspx?ArticleID=3f3084db-8fbd-48bc-be82-3396f4eaa108
http://msdn.microsoft.com/en-us/library/t07a3dye.aspx
http://blogs.msdn.com/b/shawnfa/archive/2004/03/17/91575.aspx

Happy Coding.

Srinup97, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response