ofp-util: Work on decoding OF1.1 flow_mods.
[openvswitch] / utilities / ovs-pki.8.in
1 .de IQ
2 .  br
3 .  ns
4 .  IP "\\$1"
5 ..
6 .TH ovs\-pki 8 "May 2008" "Open vSwitch" "Open vSwitch Manual"
7
8 .SH NAME
9 ovs\-pki \- OpenFlow public key infrastructure management utility
10
11 .SH SYNOPSIS
12 \fBovs\-pki\fR [\fIOPTIONS\fR] \fICOMMAND\fR [\fIARGS\fR]
13 .sp
14 Stand\-alone commands with their arguments:
15 .br
16 \fBovs\-pki\fR \fBinit\fR
17 .br
18 \fBovs\-pki\fR \fBreq\fR \fINAME\fR
19 .br
20 \fBovs\-pki\fR \fBsign\fR \fINAME\fR [\fITYPE\fR]
21 .br
22 \fBovs\-pki\fR \fBreq+sign\fR \fINAME\fR [\fITYPE\fR]
23 .br
24 \fBovs\-pki\fR \fBverify\fR \fINAME\fR [\fITYPE\fR]
25 .br
26 \fBovs\-pki\fR \fBfingerprint\fR \fIFILE\fR
27 .br
28 \fBovs\-pki\fR \fBself\-sign\fR \fINAME\fR
29 .sp
30 The following additional commands manage an online PKI:
31 .br
32 \fBovs\-pki\fR \fBls\fR [\fIPREFIX\fR] [\fITYPE\fR]
33 .br
34 \fBovs\-pki\fR \fBflush\fR [\fITYPE\fR]
35 .br
36 \fBovs\-pki\fR \fBreject\fR \fIPREFIX\fR [\fITYPE\fR]
37 .br
38 \fBovs\-pki\fR \fBapprove\fR \fIPREFIX\fR [\fITYPE\fR]
39 .br
40 \fBovs\-pki\fR \fBprompt\fR [\fITYPE\fR]
41 .br
42 \fBovs\-pki\fR \fBexpire\fR [\fIAGE\fR]
43 .sp
44 Each \fITYPE\fR above is a certificate type, either \fBswitch\fR
45 (default) or \fBcontroller\fR.
46 .sp
47 The available options are:
48 .br
49 [\fB\-k\fR \fItype\fR | \fB\-\^\-key=\fItype\fR]
50 .br
51 [\fB\-B\fR \fInbits\fR | \fB\-\^\-bits=\fInbits\fR]
52 .br
53 [\fB\-D\fR \fIfile\fR | \fB\-\^\-dsaparam=\fIfile\fR]
54 .br
55 [\fB\-b\fR | \fB\-\^\-batch\fR]
56 .br
57 [\fB\-f\fR | \fB\-\^\-force\fR]
58 .br
59 [\fB\-d\fR \fIdir\fR | \fB\-\^\-dir=\fR\fIdir\fR]
60 .br
61 [\fB\-l\fR \fIfile\fR | \fB\-\^\-log=\fIfile\fR]
62 .br
63 [\fB\-h\fR | \fB\-\^\-help\fR]
64 .sp
65 Some options do not apply to every command.
66
67 .SH DESCRIPTION
68 The \fBovs\-pki\fR program sets up and manages a public key
69 infrastructure for use with OpenFlow.  It is intended to be a simple
70 interface for organizations that do not have an established public key
71 infrastructure.  Other PKI tools can substitute for or supplement the
72 use of \fBovs\-pki\fR.
73
74 \fBovs\-pki\fR uses \fBopenssl\fR(1) for certificate management and key
75 generation.
76
77 .SH "OFFLINE COMMANDS"
78
79 The following \fBovs\-pki\fR commands support manual PKI
80 administration:
81
82 .TP
83 \fBinit\fR
84 Initializes a new PKI (by default in directory \fB@PKIDIR@\fR) and populates
85 it with a pair of certificate authorities for controllers and
86 switches.
87
88 This command should ideally be run on a high\-security machine separate
89 from any OpenFlow controller or switch, called the CA machine.  The
90 files \fBpki/controllerca/cacert.pem\fR and
91 \fBpki/switchca/cacert.pem\fR that it produces will need to be copied
92 over to the OpenFlow switches and controllers, respectively.  Their
93 contents may safely be made public.
94
95 By default, \fBovs\-pki\fR generates 2048\-bit RSA keys.  The \fB\-B\fR
96 or \fB\-\^\-bits\fR option (see below) may be used to override the key
97 length.  The \fB\-k dsa\fR or \fB\-\^\-key=dsa\fR option may be used to use
98 DSA in place of RSA.  If DSA is selected, the \fBdsaparam.pem\fR file
99 generated in the new PKI hierarchy must be copied to any machine on
100 which the \fBreq\fR command (see below) will be executed.  Its
101 contents may safely be made public.
102
103 Other files generated by \fBinit\fR may remain on the CA machine.
104 The files \fBpki/controllerca/private/cakey.pem\fR and
105 \fBpki/switchca/private/cakey.pem\fR have particularly sensitive
106 contents that should not be exposed.
107
108 .TP
109 \fBreq\fR \fINAME\fR
110 Generates a new private key named \fINAME\fR\fB\-privkey.pem\fR and
111 corresponding certificate request named \fINAME\fR\fB\-req.pem\fR.
112 The private key can be intended for use by a switch or a controller.
113
114 This command should ideally be run on the switch or controller that
115 will use the private key to identify itself.  The file
116 \fINAME\fR\fB\-req.pem\fR must be copied to the CA machine for signing
117 with the \fBsign\fR command (below).  
118
119 This command will output a fingerprint to stdout as its final step.
120 Write down the fingerprint and take it to the CA machine before
121 continuing with the \fBsign\fR step.
122
123 When RSA keys are in use (as is the default), \fBreq\fR, unlike the
124 rest of \fBovs\-pki\fR's commands, does not need access to a PKI
125 hierarchy created by \fBovs\-pki init\fR.  The \fB\-B\fR or
126 \fB\-\^\-bits\fR option (see below) may be used to specify the number of
127 bits in the generated RSA key.
128
129 When DSA keys are used (as specified with \fB\-\^\-key=dsa\fR), \fBreq\fR
130 needs access to the \fBdsaparam.pem\fR file created as part of the PKI
131 hierarchy (but not to other files in that tree).  By default,
132 \fBovs\-pki\fR looks for this file in \fB@PKIDIR@/dsaparam.pem\fR, but
133 the \fB\-D\fR or \fB\-\^\-dsaparam\fR option (see below) may be used to
134 specify an alternate location.
135
136 \fINAME\fR\fB\-privkey.pem\fR has sensitive contents that should not be
137 exposed.  \fINAME\fR\fB\-req.pem\fR may be safely made public.
138
139 .TP
140 \fBsign\fR \fINAME\fR [\fITYPE\fR]
141 Signs the certificate request named \fINAME\fR\fB\-req.pem\fR that was
142 produced in the previous step, producing a certificate named
143 \fINAME\fR\fB\-cert.pem\fR.  \fITYPE\fR, either \fBswitch\fR (default) or
144 \fBcontroller\fR, indicates the use for which the key is being
145 certified.
146
147 This command must be run on the CA machine.
148
149 The command will output a fingerprint to stdout and request that you
150 verify that it is the same fingerprint output by the \fBreq\fR
151 command.  This ensures that the request being signed is the same one
152 produced by \fBreq\fR.  (The \fB\-b\fR or \fB\-\^\-batch\fR option
153 suppresses the verification step.)
154
155 The file \fINAME\fR\fB\-cert.pem\fR will need to be copied back to the
156 switch or controller for which it is intended.  Its contents may
157 safely be made public.
158
159 .TP
160 \fBreq+sign\fR \fINAME\fR [\fITYPE\fR]
161 Combines the \fBreq\fR and \fBsign\fR commands into a single step,
162 outputting all the files produced by each.  The
163 \fINAME\fR\fB\-privkey.pem\fR and \fINAME\fR\fB\-cert.pem\fR files must
164 be copied securely to the switch or controller.
165 \fINAME\fR\fB\-privkey.pem\fR has sensitive contents and must not be
166 exposed in transit.  Afterward, it should be deleted from the CA
167 machine.
168
169 This combined method is, theoretically, less secure than the
170 individual steps performed separately on two different machines,
171 because there is additional potential for exposure of the private
172 key.  However, it is also more convenient.
173
174 .TP
175 \fBverify\fR \fINAME\fR [\fITYPE\fR]
176 Verifies that \fINAME\fR\fB\-cert.pem\fR is a valid certificate for the
177 given \fITYPE\fR of use, either \fBswitch\fR (default) or
178 \fBcontroller\fR.  If the certificate is valid for this use, it prints
179 the message ``\fINAME\fR\fB\-cert.pem\fR: OK''; otherwise, it prints an
180 error message.
181
182 .TP
183 \fBfingerprint\fR \fIFILE\fR
184 Prints the fingerprint for \fIFILE\fR.  If \fIFILE\fR is a
185 certificate, then this is the SHA\-1 digest of the DER encoded version
186 of the certificate; otherwise, it is the SHA\-1 digest of the entire
187 file.
188
189 .TP
190 \fBself\-sign\fR \fINAME\fR
191 Signs the certificate request named \fINAME\fB\-req.pem\fR using the
192 private key \fINAME\fB\-privkey.pem\fR, producing a self-signed
193 certificate named \fINAME\fB\-cert.pem\fR.  The input files should have
194 been produced with \fBovs\-pki req\fR.
195
196 Some controllers accept such self-signed certificates.
197
198 .SH "ONLINE COMMANDS"
199
200 An OpenFlow PKI can be administered online, in conjunction with
201 .BR ovs\-pki\-cgi (8)
202 and a web server such as Apache:
203
204 .IP \(bu
205 The web server exports the contents of the PKI via HTTP.  All files in
206 a PKI hierarchy files may be made public, except for the files
207 \fBpki/controllerca/private/cakey.pem\fR and
208 \fBpki/switchca/private/cakey.pem\fR, which must not be exposed.
209
210 .IP \(bu
211 \fBovs\-pki\-cgi\fR allows newly generated certificate requests for
212 controllers and switches to be uploaded into the
213 \fBpki/controllerca/incoming\fR and \fBpki/switchca/incoming\fR
214 directories, respectively.  Uploaded certificate requests are stored
215 in those directories under names of the form
216 \fIFINGERPRINT\fB\-req.pem\fR, which \fIFINGERPRINT\fR is the SHA\-1
217 hash of the file.
218
219 .IP \(bu
220 These \fBovs\-pki\fR commands allow incoming certificate requests to
221 be approved or rejected, in a form are suitable for use by humans or
222 other software.
223
224 .PP
225 The following \fBovs\-pki\fR commands support online administration:
226
227 .TP
228 \fBovs\-pki\fR \fBls\fR [\fIPREFIX\fR] [\fITYPE\fR]
229 Lists all of the incoming certificate requests of the given \fITYPE\fR
230 (either \fBswitch\fR, the default, or \fBcontroller\fR).  If
231 \fIPREFIX\fR, which must be at least 4 characters long, is specified,
232 it causes the list to be limited to files whose names begin with
233 \fIPREFIX\fR.  This is useful, for example, to avoid typing in an
234 entire fingerprint when checking that a specific certificate request
235 has been received.
236
237 .TP
238 \fBovs\-pki\fR \fBflush\fR [\fITYPE\fR]
239 Deletes all certificate requests of the given \fITYPE\fR.
240
241 .TP
242 \fBovs\-pki\fR \fBreject\fR \fIPREFIX\fR [\fITYPE\fR]
243 Rejects the certificate request whose name begins with \fIPREFIX\fR,
244 which must be at least 4 characters long, of the given type (either
245 \fBswitch\fR, the default, or \fBcontroller\fR).  \fIPREFIX\fR must
246 match exactly one certificate request; its purpose is to allow the
247 user to type fewer characters, not to match multiple certificate
248 requests.
249
250 .TP
251 \fBovs\-pki\fR \fBapprove\fR \fIPREFIX\fR [\fITYPE\fR]
252 Approves the certificate request whose name begins with \fIPREFIX\fR,
253 which must be at least 4 characters long, of the given \fITYPE\fR
254 (either \fBswitch\fR, the default, or \fBcontroller\fR).  \fIPREFIX\fR
255 must match exactly one certificate request; its purpose is to allow
256 the user to type fewer characters, not to match multiple certificate
257 requests.
258
259 The command will output a fingerprint to stdout and request that you
260 verify that it is correct.  (The \fB\-b\fR or \fB\-\^\-batch\fR option
261 suppresses the verification step.)
262
263 .TP
264 \fBovs\-pki\fR \fBprompt\fR [\fITYPE\fR]
265 Prompts the user for each incoming certificate request of the given
266 \fITYPE\fR (either \fBswitch\fR, the default, or \fBcontroller\fR).
267 Based on the certificate request's fingerprint, the user is given the
268 option of approving, rejecting, or skipping the certificate request.
269
270 .TP
271 \fBovs\-pki\fR \fBexpire\fR [\fIAGE\fR]
272
273 Rejects all the incoming certificate requests, of either type, that is
274 older than \fIAGE\fR, which must in one of the forms \fIN\fBs\fR,
275 \fIN\fBmin\fR, \fIN\fBh\fR, \fIN\fBday\fR.  The default is \fB1day\fR.
276
277 .SH OPTIONS
278 .IP "\fB\-k\fR \fItype\fR"
279 .IQ "\fB\-\^\-key=\fItype\fR"
280 For the \fBinit\fR command, sets the public key algorithm to use for
281 the new PKI hierarchy.  For the \fBreq\fR and \fBreq+sign\fR commands,
282 sets the public key algorithm to use for the key to be generated,
283 which must match the value specified on \fBinit\fR.  With other
284 commands, the value has no effect.
285
286 The \fItype\fR may be \fBrsa\fR (the default) or \fBdsa\fR.
287
288 .IP "\fB\-B\fR \fInbits\fR"
289 .IQ "\fB\-\^\-bits=\fInbits\fR"
290 Sets the number of bits in the key to be generated.  When RSA keys are
291 in use, this option affects only the \fBinit\fR, \fBreq\fR, and
292 \fBreq+sign\fR commands, and the same value should be given each time.
293 With DSA keys are in use, this option affects only the \fBinit\fR
294 command.
295
296 The value must be at least 1024.  The default is 2048.
297
298 .IP "\fB\-D\fR \fIfile\fR"
299 .IQ "\fB\-\^\-dsaparam=\fIfile\fR"
300 Specifies an alternate location for the \fBdsaparam.pem\fR file
301 required by the \fBreq\fR and \fBreq+sign\fR commands.  This option
302 affects only these commands, and only when DSA keys are used.
303
304 The default is \fBdsaparam.pem\fR under the PKI hierarchy.
305
306 .IP "\fB\-b\fR"
307 .IQ "\fB\-\^\-batch\fR"
308 Suppresses the interactive verification of fingerprints that the
309 \fBsign\fR and \fBapprove\fR commands by default require.
310
311 .IP "\fB\-d\fR \fIdir\fR"
312 .IQ "\fB\-\^\-dir=\fR\fIdir\fR"
313 Specifies the location of the PKI hierarchy to be used or created by
314 the command (default: \fB@PKIDIR@\fR).  All commands, except \fBreq\fR,
315 need access to a PKI hierarchy.
316
317 .IP "\fB\-f\fR"
318 .IQ "\fB\-\^\-force\fR"
319 By default, \fBovs\-pki\fR will not overwrite existing files or
320 directories.  This option overrides this behavior.
321
322 .IP "\fB\-l\fR \fIfile\fR"
323 .IQ "\fB\-\^\-log=\fIfile\fR"
324 Sets the log file to \fIfile\fR.  Default:
325 \fB@LOGDIR@/ovs\-pki.log\fR.
326
327 .IP "\fB\-h\fR"
328 .IQ "\fB\-\^\-help\fR"
329 Prints a help usage message and exits.
330
331 .SH "SEE ALSO"
332
333 .BR ovs\-controller (8),
334 .BR ovs\-pki\-cgi (8)