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