Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / man / sn.1
1 .\" 
2 .\" sn manual page.
3 .\" Copyright 2003 Motus Technologies
4 .\" Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
5 .\" Author:
6 .\"   Sebastien Pouliot <sebastien@ximian.com>
7 .\"
8 .TH Mono "sn"
9 .SH NAME
10 sn \- Digitally sign/verify/compare strongnames on CLR assemblies.
11 .SH SYNOPSIS
12 .PP
13 .B sn [-q | -quiet] [options] [parameters]
14 .SH DESCRIPTION
15 Digitally sign, verify or compare CLR assemblies using strongnames.
16 .PP
17 You can use the sn command to create "snk files" using the -k option
18 described below.
19 .SH CONFIGURATION OPTIONS
20 Configuration options are stored in the machine.config configuration file
21 under /configuration/strongNames.
22 .TP
23 .I "-c provider"
24 Change the default CSP (Crypto Service Provider). Currently not supported
25 in Mono.
26 .TP
27 .I "-m [y|n]"
28 Use a machine [y] key container or a user [n] key container. Currently not
29 supported in Mono.
30 .TP
31 .I "-Vl"
32 List the verification options. The list is kept under /configuration/
33 strongNames/verificationSettings in machine.config.
34 .TP
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
38 require this.
39 .TP
40 .I "-Vu assembly"
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.
43 .TP
44 .I "-Vx"
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
48 .TP
49 .I "-d container"
50 Delete the keypair present in the specified key container.
51 .TP
52 .I "-i keypair.snk container"
53 Import the specified strongname file into the specified container.
54 .TP
55 .I "-pc container publickey"
56 Export the public key from the specified CSP container to the specified file.
57 .SH CONVERSION OPTIONS
58 .TP
59 .I "-e assembly output.pub"
60 Export the assembly public key to the specified output file.
61 .TP
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.
65 .TP
66 .I "-o input output.txt"
67 Convert the input file to a CSV file (using decimal).
68 .TP
69 .I "-oh input output.txt"
70 Convert the input file to a CSV file (using hexadecimal).
71 .SH STRONGNAME SIGNING OPTIONS
72 .TP
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.
76 .TP
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.
84 .TP
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).
90 .TP
91 .I "-Rc assembly container"
92 Re-sign the specified assembly using the specified strongname container.
93 .TP
94 .I "-t file"
95 Show the public key token from the specified file.
96 .TP
97 .I "-tp file"
98 Show the public key and the public key token from the specified file.
99 .TP
100 .I "-T assembly"
101 Show the public key token from the specified assembly.
102 .TP
103 .I "-Tp assembly"
104 Show the public key and the public key token from the specified assembly.
105 .TP
106 .I "-v assembly"
107 Verify the specified assembly signature.
108 .TP
109 .I "-vf assembly"
110 Verify the specified assembly signature (even if disabled).
111 .SH HELP OPTIONS
112 .TP
113 .I "-h", "-?"
114 Display basic help about this tool.
115 .TP
116 .I "-h config", "-? config"
117 Display configuration related help about this tool.
118 .TP
119 .I "-h csp", "-? csp"
120 Display Cryptographic Service Provider related help about this tool.
121 .TP
122 .I "-h convert", "-? convert"
123 Display conversion related help about this tool.
124 .TP
125 .I "-h sn", "-? sn"
126 Display strongname related help about this tool.
127 .SH CONFIGURATION FILE
128 .TP
129 Strongnames configuration is kept in "machine.config" file. Currently two 
130 features can be configured.
131 .TP
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" 
142 PublicKey="00..." />
143 .TP
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.
151 .SH AUTHOR
152 Written by Sebastien Pouliot
153 .SH COPYRIGHT
154 Copyright (C) 2003 Motus Technologies. 
155 Copyright (C) 2004 Novell. 
156 Released under BSD license.
157 .SH MAILING LISTS
158 Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
159 .SH WEB SITE
160 Visit http://www.mono-project.com for details
161 .SH SEE ALSO
162 .BR secutil(1)