Setting key information

The .NET Framework ships with a command-line utility called the strong name utility, or sn for short, which helps build strong names for .NET assemblies. One of its most frequently used features enables the generation of a new set of digital signature keys that can be installed into an assembly and used as a part of the strong name for an assembly. The keys are written into a binary file, whose name is specified with the -k argument to the sn utility, as shown in the following command line:

sn -k KeyPair.snk

This command line instructs the sn utility to generate a new pair of digital signature keys and output the keys to a binary file named KeyPair.snk. This file is named as an argument to an attribute called AssemblyKeyFile:

[assembly: AssemblyKeyFile("KeyPair.snk")]

The .snk extension is not required. Any extension can be used for the key file generated by the strong name utility.

0 0

Post a comment