Monday, June 17, 2013

Delay signing an Assembly

Delay signing is the process of delaying the actual signing process, if we use the normal signing process then the details of the private and public key will be available to all the developers who are involved in developing the Assembly.

The organization might want to restrict access to the private key only to a set of key individuals and not to all, delay signing process can be used to achieve this.

Delay signing can be achieved by specifying the AssemblyDelaySignAttribute attribute to true in the assemblyInfo file, on doing so the runtime will not sign the Assembly, but will reserve space in the PE file for the strong name which can be specified later.
Since the assembly is not fully signed, validation of the assembly will fail, we can disable validation by using the sn.exe tool as follows.
sn –Vr myAssembly.dll

Once all the development activities are completed, and when the Assembly is ready for production, we can sign the assembly with the actual keys using the –R option of the sn.exe utility as follows.
sn -R myAssembly.dll myKeySet.snk

Search Flipkart Products:
Flipkart.com

No comments: