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