3 .\" Copyright 2003 Motus Technologies
4 .\" Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
6 .\" Sebastien Pouliot <sebastien@ximian.com>
10 sn \- Digitally sign/verify/compare strongname on CLR assemblies.
13 .B sn [-q | -quiet] [options] [parameters]
15 Digitally sign, verify or compare, CLR assemblies using strongnames.
16 .SH CONFIGURATION OPTIONS
17 Configuration options are stored in the machine.config configuration file
18 under /configuration/strongNames.
21 Change the default CSP (Crypto Service Provider). Currently not supported
25 Use a machine [y] key container or a user [n] key container. Currently not
29 List the verification options. The list is kept under /configuration/
30 strongNames/verificationSettings in machine.config.
32 .I "-Vr assembly [userlist]"
33 Exempt the specified assembly from verification for the specified user list.
34 Currently not supported by sn, you must edit machine.config manually if you
38 Remove the exemption entry for the specified assembly. Currently not
39 supported by sn, you must edit machine.config manually if you require this.
42 Remove all exemptions entries. Currently not supported by sn, you must edit
43 machine.config manually if you require this.
44 .SH CSP RELATED OPTIONS
47 Delete the keypair present in the specified key container.
49 .I "-i keypair.snk container"
50 Import the specified strongname file into the specified container.
52 .I "-pc container publickey"
53 Export the public key from the specified CSP container to the specified file.
54 .SH CONVERTION OPTIONS
56 .I "-e assembly output.pub"
57 Export the assembly public key to the specified output file.
59 .I "-p keypair.snk output.pub"
60 Export the public key from the specified strongname key file (SNK) to the
61 specified output file.
63 .I "-o input output.txt"
64 Convert the input file to a CSV file (using decimal).
66 .I "-oh input output.txt"
67 Convert the input file to a CSV file (using hexadecimal).
68 .SH STRONGNAME SIGNING OPTIONS
70 .I "-D assembly1 assembly2"
71 Compare if assembly1 and assembly are the same exception for their signature.
72 This is done by comparing the hash of the metadata of both assembly.
74 .I "-k [size] keypair.snk"
75 Create a new strongname keypair in the specified file. The default key
76 length is 1024 bits and MUST ALWAYS be used when signing 1.x assemblies.
77 Any value from 384 to 16384 bits (in increments of 8 bits) is a valid key
78 length to sign 2.x assemblies. To ensure maximum compatibility you may
79 want to continue using 1024 bits keys. Note that there's no good reason,
80 even if it's possible, to use length lesser than 1024 bits.
82 .I "-R assembly keypair.snk"
83 Resign the specified assembly using the specified strongname keypair file
84 (SNK). You can only sign an assembly with the private key (SNK) that match
85 the public key inside the assembly (unless it's public key token has been
86 remapped in machine.config).
88 .I "-Rc assembly container"
89 Resign the specified assembly using the specified strongname container.
92 Show the public key from the specified file.
95 Show the public key and the public key token from the specified file.
98 Show the public key from the specified assembly.
101 Show the public key and the public key token from the specified assembly.
104 Verify the specified assembly signature.
107 Verify the specified assembly signature (even if disabled).
111 Display basic help about this tool.
113 .I "-h config", "-? config"
114 Display configuration related help about this tool.
116 .I "-h csp", "-? csp"
117 Display Cryptographic Service Provider related help about this tool.
119 .I "-h convert", "-? convert"
120 Display convertion related help about this tool.
123 Display strongname related help about this tool.
124 .SH CONFIGURATION FILE
126 Strongnames configuration is kept in "machine.config" file. Currently two
127 features can be configured.
129 .I "/configuration/strongNames/pubTokenMapping"
130 This mechanism let Mono remap a public key token, like the ECMA token, to
131 another public key for verification. This is useful in two scenarios. First
132 assemblies signed with the "ECMA key" needs to be verified by the "runtime"
133 key (as the ECMA key isn't a public key). Second, many assemblies are signed
134 with private keys that Mono can't use (e.g. System.Security.dll assembly).
135 A new key cannot be used because it should change thr strongname (a new key
136 pair would have a new public key which would produce a new token). Public
137 key token remapping is the solution for both problems. Each token must be
138 configured in a "map" entry similar to this one: <map Token="b77a5c561934e089"
141 .I "/configuration/strongNames/verificationSettings"
142 It is often useful during development to use delay signed assemblies.
143 Normally* the runtime wouldn't allow delay-signed assemblies to be loaded.
144 This feature allows some delay-signed assemblies (based on their public key
145 token, optionally assembly name and user name) to be used like they were
146 fully signed assemblies. [*] Note that Mono 1.0 "runtime" doesn't validate
147 strongname signatures so this option shouldn't be required in most scenarios.
149 Written by Sebastien Pouliot
151 Copyright (C) 2003 Motus Technologies.
152 Copyright (C) 2004 Novell.
153 Released under BSD license.
155 Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
157 Visit http://www.mono-project.com for details