svn path=/branches/mono-1-1-9/mcs/; revision=51207
[mono.git] / man / sn.1
1 .\" 
2 .\" sn manual page.
3 .\" Copyright 2003 Motus Technologies
4 .\" Copyright 2004 Novell
5 .\" Author:
6 .\"   Sebastien Pouliot <sebastien@ximian.com>
7 .\"
8 .TH Mono "sn"
9 .SH NAME
10 sn \- Digitally sign/verify/compare strongname 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 .SH CONFIGURATION OPTIONS
17 Configuration options are stored in the machine.config configuration file
18 under /configuration/strongNames.
19 .TP
20 .I "-c provider"
21 Change the default CSP (Crypto Service Provider). Currently not supported
22 in Mono.
23 .TP
24 .I "-m [y|n]"
25 Use a machine [y] key container or a user [n] key container. Currently not
26 supported in Mono.
27 .TP
28 .I "-Vl"
29 List the verification options. The list is kept under /configuration/
30 strongNames/verificationSettings in machine.config.
31 .TP
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
35 require this.
36 .TP
37 .I "-Vu assembly"
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.
40 .TP
41 .I "-Vx"
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
45 .TP
46 .I "-d container"
47 Delete the keypair present in the specified key container.
48 .TP
49 .I "-i keypair.snk container"
50 Import the specified strongname file into the specified container.
51 .TP
52 .I "-pc container publickey"
53 Export the public key from the specified CSP container to the specified file.
54 .SH CONVERTION OPTIONS
55 .TP
56 .I "-e assembly output.pub"
57 Export the assembly public key to the specified output file.
58 .TP
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.
62 .TP
63 .I "-o input output.txt"
64 Convert the input file to a CSV file (using decimal).
65 .TP
66 .I "-oh input output.txt"
67 Convert the input file to a CSV file (using hexadecimal).
68 .SH STRONGNAME SIGNING OPTIONS
69 .TP
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.
73 .TP
74 .I "-k keypair.snk"
75 Create a new strongname keypair (a 1024 bits RSA keypair) in the specified 
76 file.
77 .TP
78 .I "-R assembly keypair.snk"
79 Resign the specified assembly using the specified strongname keypair file 
80 (SNK). You can only sign an assembly with the private key (SNK) that match 
81 the public key inside the assembly (unless it's public key token has been
82 remapped in machine.config).
83 .TP
84 .I "-Rc assembly container"
85 Resign the specified assembly using the specified strongname container.
86 .TP
87 .I "-t file"
88 Show the public key from the specified file.
89 .TP
90 .I "-tp file"
91 Show the public key and the public key token from the specified file.
92 .TP
93 .I "-T assembly"
94 Show the public key from the specified assembly.
95 .TP
96 .I "-Tp assembly"
97 Show the public key and the public key token from the specified assembly.
98 .TP
99 .I "-v assembly"
100 Verify the specified assembly signature.
101 .TP
102 .I "-vf assembly"
103 Verify the specified assembly signature (even if disabled).
104 .SH HELP OPTIONS
105 .TP
106 .I "-h", "-?"
107 Display basic help about this tool.
108 .TP
109 .I "-h config", "-? config"
110 Display configuration related help about this tool.
111 .TP
112 .I "-h csp", "-? csp"
113 Display Cryptographic Service Provider related help about this tool.
114 .TP
115 .I "-h convert", "-? convert"
116 Display convertion related help about this tool.
117 .TP
118 .I "-h sn", "-? sn"
119 Display strongname related help about this tool.
120 .SH CONFIGURATION FILE
121 .TP
122 Strongnames configuration is kept in "machine.config" file. Currently two 
123 features can be configured.
124 .TP
125 .I "/configuration/strongNames/pubTokenMapping"
126 This mechanism let Mono remap a public key token, like the ECMA token, to
127 another public key for verification. This is useful in two scenarios. First 
128 assemblies signed with the "ECMA key" needs to be verified by the "runtime"
129 key (as the ECMA key isn't a public key). Second, many assemblies are signed
130 with private keys that Mono can't use (e.g. System.Security.dll assembly).
131 A new key cannot be used because it should change thr strongname (a new key 
132 pair would have a new public key which would produce a new token). Public 
133 key token remapping is the solution for both problems. Each token must be
134 configured in a "map" entry similar to this one: <map Token="b77a5c561934e089" 
135 PublicKey="00..." />
136 .TP
137 .I "/configuration/strongNames/verificationSettings"
138 It is often useful during development to use delay signed assemblies. 
139 Normally* the runtime wouldn't allow delay-signed assemblies to be loaded.
140 This feature allows some delay-signed assemblies (based on their public key
141 token, optionally assembly name and user name) to be used like they were 
142 fully signed assemblies. [*] Note that Mono 1.0 "runtime" doesn't validate 
143 strongname signatures so this option shouldn't be required in most scenarios.
144 .SH AUTHOR
145 Written by Sebastien Pouliot
146 .SH COPYRIGHT
147 Copyright (C) 2003 Motus Technologies. 
148 Copyright (C) 2004 Novell. 
149 Released under BSD license.
150 .SH MAILING LISTS
151 Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
152 .SH WEB SITE
153 Visit http://www.mono-project.com for details
154 .SH SEE ALSO
155 .BR secutil(1)