Merge from vendor branch CVS:
[dragonfly.git] / secure / usr.bin / openssl / man / ocsp.1
1 .\" Automatically generated by Pod::Man version 1.15
2 .\" Wed Feb 19 16:49:33 2003
3 .\"
4 .\" Standard preamble:
5 .\" ======================================================================
6 .de Sh \" Subsection heading
7 .br
8 .if t .Sp
9 .ne 5
10 .PP
11 \fB\\$1\fR
12 .PP
13 ..
14 .de Sp \" Vertical space (when we can't use .PP)
15 .if t .sp .5v
16 .if n .sp
17 ..
18 .de Ip \" List item
19 .br
20 .ie \\n(.$>=3 .ne \\$3
21 .el .ne 3
22 .IP "\\$1" \\$2
23 ..
24 .de Vb \" Begin verbatim text
25 .ft CW
26 .nf
27 .ne \\$1
28 ..
29 .de Ve \" End verbatim text
30 .ft R
31
32 .fi
33 ..
34 .\" Set up some character translations and predefined strings.  \*(-- will
35 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
36 .\" double quote, and \*(R" will give a right double quote.  | will give a
37 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used
38 .\" to do unbreakable dashes and therefore won't be available.  \*(C` and
39 .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
40 .tr \(*W-|\(bv\*(Tr
41 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
42 .ie n \{\
43 .    ds -- \(*W-
44 .    ds PI pi
45 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
46 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
47 .    ds L" ""
48 .    ds R" ""
49 .    ds C` ""
50 .    ds C' ""
51 'br\}
52 .el\{\
53 .    ds -- \|\(em\|
54 .    ds PI \(*p
55 .    ds L" ``
56 .    ds R" ''
57 'br\}
58 .\"
59 .\" If the F register is turned on, we'll generate index entries on stderr
60 .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
61 .\" index entries marked with X<> in POD.  Of course, you'll have to process
62 .\" the output yourself in some meaningful fashion.
63 .if \nF \{\
64 .    de IX
65 .    tm Index:\\$1\t\\n%\t"\\$2"
66 ..
67 .    nr % 0
68 .    rr F
69 .\}
70 .\"
71 .\" For nroff, turn off justification.  Always turn off hyphenation; it
72 .\" makes way too many mistakes in technical documents.
73 .hy 0
74 .if n .na
75 .\"
76 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
77 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
78 .bd B 3
79 .    \" fudge factors for nroff and troff
80 .if n \{\
81 .    ds #H 0
82 .    ds #V .8m
83 .    ds #F .3m
84 .    ds #[ \f1
85 .    ds #] \fP
86 .\}
87 .if t \{\
88 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
89 .    ds #V .6m
90 .    ds #F 0
91 .    ds #[ \&
92 .    ds #] \&
93 .\}
94 .    \" simple accents for nroff and troff
95 .if n \{\
96 .    ds ' \&
97 .    ds ` \&
98 .    ds ^ \&
99 .    ds , \&
100 .    ds ~ ~
101 .    ds /
102 .\}
103 .if t \{\
104 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
105 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
106 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
107 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
108 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
109 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
110 .\}
111 .    \" troff and (daisy-wheel) nroff accents
112 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
113 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
114 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
115 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
116 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
117 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
118 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
119 .ds ae a\h'-(\w'a'u*4/10)'e
120 .ds Ae A\h'-(\w'A'u*4/10)'E
121 .    \" corrections for vroff
122 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
123 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
124 .    \" for low resolution devices (crt and lpr)
125 .if \n(.H>23 .if \n(.V>19 \
126 \{\
127 .    ds : e
128 .    ds 8 ss
129 .    ds o a
130 .    ds d- d\h'-1'\(ga
131 .    ds D- D\h'-1'\(hy
132 .    ds th \o'bp'
133 .    ds Th \o'LP'
134 .    ds ae ae
135 .    ds Ae AE
136 .\}
137 .rm #[ #] #H #V #F C
138 .\" ======================================================================
139 .\"
140 .IX Title "OCSP 1"
141 .TH OCSP 1 "0.9.7a" "2003-02-19" "OpenSSL"
142 .UC
143 .SH "NAME"
144 ocsp \- Online Certificate Status Protocol utility
145 .SH "SYNOPSIS"
146 .IX Header "SYNOPSIS"
147 \&\fBopenssl\fR \fBocsp\fR
148 [\fB\-out file\fR]
149 [\fB\-issuer file\fR]
150 [\fB\-cert file\fR]
151 [\fB\-serial n\fR]
152 [\fB\-req_text\fR]
153 [\fB\-resp_text\fR]
154 [\fB\-text\fR]
155 [\fB\-reqout file\fR]
156 [\fB\-respout file\fR]
157 [\fB\-reqin file\fR]
158 [\fB\-respin file\fR]
159 [\fB\-nonce\fR]
160 [\fB\-no_nonce\fR]
161 [\fB\-url responder_url\fR]
162 [\fB\-host host:n\fR]
163 [\fB\-path\fR]
164 [\fB\-CApath file\fR]
165 [\fB\-CAfile file\fR]
166 [\fB\-VAfile file\fR]
167 [\fB\-verify_certs file\fR]
168 [\fB\-noverify\fR]
169 [\fB\-trust_other\fR]
170 [\fB\-no_intern\fR]
171 [\fB\-no_sig_verify\fR]
172 [\fB\-no_cert_verify\fR]
173 [\fB\-no_chain\fR]
174 [\fB\-no_cert_checks\fR]
175 [\fB\-validity_period nsec\fR]
176 [\fB\-status_age nsec\fR]
177 .SH "DESCRIPTION"
178 .IX Header "DESCRIPTION"
179 \&\fB\s-1WARNING:\s0 this documentation is preliminary and subject to change.\fR
180 .PP
181 The Online Certificate Status Protocol (\s-1OCSP\s0) enables applications to
182 determine the (revocation) state of an identified certificate (\s-1RFC\s0 2560).
183 .PP
184 The \fBocsp\fR command performs many common \s-1OCSP\s0 tasks. It can be used
185 to print out requests and responses, create requests and send queries
186 to an \s-1OCSP\s0 responder and behave like a mini \s-1OCSP\s0 server itself.
187 .SH "OCSP CLIENT OPTIONS"
188 .IX Header "OCSP CLIENT OPTIONS"
189 .Ip "\fB\-out filename\fR" 4
190 .IX Item "-out filename"
191 specify output filename, default is standard output.
192 .Ip "\fB\-issuer filename\fR" 4
193 .IX Item "-issuer filename"
194 This specifies the current issuer certificate. This option can be used
195 multiple times. The certificate specified in \fBfilename\fR must be in
196 \&\s-1PEM\s0 format.
197 .Ip "\fB\-cert filename\fR" 4
198 .IX Item "-cert filename"
199 Add the certificate \fBfilename\fR to the request. The issuer certificate
200 is taken from the previous \fBissuer\fR option, or an error occurs if no
201 issuer certificate is specified.
202 .Ip "\fB\-serial num\fR" 4
203 .IX Item "-serial num"
204 Same as the \fBcert\fR option except the certificate with serial number
205 \&\fBnum\fR is added to the request. The serial number is interpreted as a
206 decimal integer unless preceded by \fB0x\fR. Negative integers can also
207 be specified by preceding the value by a \fB-\fR sign.
208 .Ip "\fB\-signer filename\fR, \fB\-signkey filename\fR" 4
209 .IX Item "-signer filename, -signkey filename"
210 Sign the \s-1OCSP\s0 request using the certificate specified in the \fBsigner\fR
211 option and the private key specified by the \fBsignkey\fR option. If
212 the \fBsignkey\fR option is not present then the private key is read
213 from the same file as the certificate. If neither option is specified then
214 the \s-1OCSP\s0 request is not signed.
215 .Ip "\fB\-nonce\fR, \fB\-no_nonce\fR" 4
216 .IX Item "-nonce, -no_nonce"
217 Add an \s-1OCSP\s0 nonce extension to a request or disable \s-1OCSP\s0 nonce addition.
218 Normally if an \s-1OCSP\s0 request is input using the \fBrespin\fR option no
219 nonce is added: using the \fBnonce\fR option will force addition of a nonce.
220 If an \s-1OCSP\s0 request is being created (using \fBcert\fR and \fBserial\fR options)
221 a nonce is automatically added specifying \fBno_nonce\fR overrides this.
222 .Ip "\fB\-req_text\fR, \fB\-resp_text\fR, \fB\-text\fR" 4
223 .IX Item "-req_text, -resp_text, -text"
224 print out the text form of the \s-1OCSP\s0 request, response or both respectively.
225 .Ip "\fB\-reqout file\fR, \fB\-respout file\fR" 4
226 .IX Item "-reqout file, -respout file"
227 write out the \s-1DER\s0 encoded certificate request or response to \fBfile\fR.
228 .Ip "\fB\-reqin file\fR, \fB\-respin file\fR" 4
229 .IX Item "-reqin file, -respin file"
230 read \s-1OCSP\s0 request or response file from \fBfile\fR. These option are ignored
231 if \s-1OCSP\s0 request or response creation is implied by other options (for example
232 with \fBserial\fR, \fBcert\fR and \fBhost\fR options).
233 .Ip "\fB\-url responder_url\fR" 4
234 .IX Item "-url responder_url"
235 specify the responder \s-1URL\s0. Both \s-1HTTP\s0 and \s-1HTTPS\s0 (\s-1SSL/TLS\s0) URLs can be specified.
236 .Ip "\fB\-host hostname:port\fR, \fB\-path pathname\fR" 4
237 .IX Item "-host hostname:port, -path pathname"
238 if the \fBhost\fR option is present then the \s-1OCSP\s0 request is sent to the host
239 \&\fBhostname\fR on port \fBport\fR. \fBpath\fR specifies the \s-1HTTP\s0 path name to use
240 or \*(L"/\*(R" by default.
241 .Ip "\fB\-CAfile file\fR, \fB\-CApath pathname\fR" 4
242 .IX Item "-CAfile file, -CApath pathname"
243 file or pathname containing trusted \s-1CA\s0 certificates. These are used to verify
244 the signature on the \s-1OCSP\s0 response.
245 .Ip "\fB\-verify_certs file\fR" 4
246 .IX Item "-verify_certs file"
247 file containing additional certificates to search when attempting to locate
248 the \s-1OCSP\s0 response signing certificate. Some responders omit the actual signer's
249 certificate from the response: this option can be used to supply the necessary
250 certificate in such cases.
251 .Ip "\fB\-trust_other\fR" 4
252 .IX Item "-trust_other"
253 the certificates specified by the \fB\-verify_certs\fR option should be explicitly
254 trusted and no additional checks will be performed on them. This is useful
255 when the complete responder certificate chain is not available or trusting a
256 root \s-1CA\s0 is not appropriate.
257 .Ip "\fB\-VAfile file\fR" 4
258 .IX Item "-VAfile file"
259 file containing explicitly trusted responder certificates. Equivalent to the
260 \&\fB\-verify_certs\fR and \fB\-trust_other\fR options.
261 .Ip "\fB\-noverify\fR" 4
262 .IX Item "-noverify"
263 don't attempt to verify the \s-1OCSP\s0 response signature or the nonce values. This
264 option will normally only be used for debugging since it disables all verification
265 of the responders certificate.
266 .Ip "\fB\-no_intern\fR" 4
267 .IX Item "-no_intern"
268 ignore certificates contained in the \s-1OCSP\s0 response when searching for the
269 signers certificate. With this option the signers certificate must be specified
270 with either the \fB\-verify_certs\fR or \fB\-VAfile\fR options.
271 .Ip "\fB\-no_sig_verify\fR" 4
272 .IX Item "-no_sig_verify"
273 don't check the signature on the \s-1OCSP\s0 response. Since this option tolerates invalid
274 signatures on \s-1OCSP\s0 responses it will normally only be used for testing purposes.
275 .Ip "\fB\-no_cert_verify\fR" 4
276 .IX Item "-no_cert_verify"
277 don't verify the \s-1OCSP\s0 response signers certificate at all. Since this option allows
278 the \s-1OCSP\s0 response to be signed by any certificate it should only be used for
279 testing purposes.
280 .Ip "\fB\-no_chain\fR" 4
281 .IX Item "-no_chain"
282 do not use certificates in the response as additional untrusted \s-1CA\s0
283 certificates.
284 .Ip "\fB\-no_cert_checks\fR" 4
285 .IX Item "-no_cert_checks"
286 don't perform any additional checks on the \s-1OCSP\s0 response signers certificate.
287 That is do not make any checks to see if the signers certificate is authorised
288 to provide the necessary status information: as a result this option should
289 only be used for testing purposes.
290 .Ip "\fB\-validity_period nsec\fR, \fB\-status_age age\fR" 4
291 .IX Item "-validity_period nsec, -status_age age"
292 these options specify the range of times, in seconds, which will be tolerated
293 in an \s-1OCSP\s0 response. Each certificate status response includes a \fBnotBefore\fR time and
294 an optional \fBnotAfter\fR time. The current time should fall between these two values, but
295 the interval between the two times may be only a few seconds. In practice the \s-1OCSP\s0
296 responder and clients clocks may not be precisely synchronised and so such a check
297 may fail. To avoid this the \fB\-validity_period\fR option can be used to specify an
298 acceptable error range in seconds, the default value is 5 minutes.
299 .Sp
300 If the \fBnotAfter\fR time is omitted from a response then this means that new status
301 information is immediately available. In this case the age of the \fBnotBefore\fR field
302 is checked to see it is not older than \fBage\fR seconds old. By default this additional
303 check is not performed.
304 .SH "OCSP SERVER OPTIONS"
305 .IX Header "OCSP SERVER OPTIONS"
306 .Ip "\fB\-index indexfile\fR" 4
307 .IX Item "-index indexfile"
308 \&\fBindexfile\fR is a text index file in \fBca\fR format containing certificate revocation
309 information.
310 .Sp
311 If the \fBindex\fR option is specified the \fBocsp\fR utility is in responder mode, otherwise
312 it is in client mode. The \fIrequest\fR\|(s) the responder processes can be either specified on
313 the command line (using \fBissuer\fR and \fBserial\fR options), supplied in a file (using the
314 \&\fBrespin\fR option) or via external \s-1OCSP\s0 clients (if \fBport\fR or \fBurl\fR is specified).
315 .Sp
316 If the \fBindex\fR option is present then the \fB\s-1CA\s0\fR and \fBrsigner\fR options must also be
317 present.
318 .Ip "\fB\-CA file\fR" 4
319 .IX Item "-CA file"
320 \&\s-1CA\s0 certificate corresponding to the revocation information in \fBindexfile\fR.
321 .Ip "\fB\-rsigner file\fR" 4
322 .IX Item "-rsigner file"
323 The certificate to sign \s-1OCSP\s0 responses with.
324 .Ip "\fB\-rother file\fR" 4
325 .IX Item "-rother file"
326 Additional certificates to include in the \s-1OCSP\s0 response.
327 .Ip "\fB\-resp_no_certs\fR" 4
328 .IX Item "-resp_no_certs"
329 Don't include any certificates in the \s-1OCSP\s0 response.
330 .Ip "\fB\-resp_key_id\fR" 4
331 .IX Item "-resp_key_id"
332 Identify the signer certificate using the key \s-1ID\s0, default is to use the subject name.
333 .Ip "\fB\-rkey file\fR" 4
334 .IX Item "-rkey file"
335 The private key to sign \s-1OCSP\s0 responses with: if not present the file specified in the
336 \&\fBrsigner\fR option is used.
337 .Ip "\fB\-port portnum\fR" 4
338 .IX Item "-port portnum"
339 Port to listen for \s-1OCSP\s0 requests on. The port may also be specified using the \fBurl\fR
340 option.
341 .Ip "\fB\-nrequest number\fR" 4
342 .IX Item "-nrequest number"
343 The \s-1OCSP\s0 server will exit after receiving \fBnumber\fR requests, default unlimited. 
344 .Ip "\fB\-nmin minutes\fR, \fB\-ndays days\fR" 4
345 .IX Item "-nmin minutes, -ndays days"
346 Number of minutes or days when fresh revocation information is available: used in the
347 \&\fBnextUpdate\fR field. If neither option is present then the \fBnextUpdate\fR field is 
348 omitted meaning fresh revocation information is immediately available.
349 .SH "OCSP Response verification."
350 .IX Header "OCSP Response verification."
351 \&\s-1OCSP\s0 Response follows the rules specified in \s-1RFC2560\s0.
352 .PP
353 Initially the \s-1OCSP\s0 responder certificate is located and the signature on
354 the \s-1OCSP\s0 request checked using the responder certificate's public key.
355 .PP
356 Then a normal certificate verify is performed on the \s-1OCSP\s0 responder certificate
357 building up a certificate chain in the process. The locations of the trusted
358 certificates used to build the chain can be specified by the \fBCAfile\fR
359 and \fBCApath\fR options or they will be looked for in the standard OpenSSL
360 certificates directory.
361 .PP
362 If the initial verify fails then the \s-1OCSP\s0 verify process halts with an
363 error.
364 .PP
365 Otherwise the issuing \s-1CA\s0 certificate in the request is compared to the \s-1OCSP\s0
366 responder certificate: if there is a match then the \s-1OCSP\s0 verify succeeds.
367 .PP
368 Otherwise the \s-1OCSP\s0 responder certificate's \s-1CA\s0 is checked against the issuing
369 \&\s-1CA\s0 certificate in the request. If there is a match and the OCSPSigning
370 extended key usage is present in the \s-1OCSP\s0 responder certificate then the
371 \&\s-1OCSP\s0 verify succeeds.
372 .PP
373 Otherwise the root \s-1CA\s0 of the \s-1OCSP\s0 responders \s-1CA\s0 is checked to see if it
374 is trusted for \s-1OCSP\s0 signing. If it is the \s-1OCSP\s0 verify succeeds.
375 .PP
376 If none of these checks is successful then the \s-1OCSP\s0 verify fails.
377 .PP
378 What this effectively means if that if the \s-1OCSP\s0 responder certificate is
379 authorised directly by the \s-1CA\s0 it is issuing revocation information about
380 (and it is correctly configured) then verification will succeed.
381 .PP
382 If the \s-1OCSP\s0 responder is a \*(L"global responder\*(R" which can give details about
383 multiple CAs and has its own separate certificate chain then its root
384 \&\s-1CA\s0 can be trusted for \s-1OCSP\s0 signing. For example:
385 .PP
386 .Vb 1
387 \& openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem
388 .Ve
389 Alternatively the responder certificate itself can be explicitly trusted
390 with the \fB\-VAfile\fR option.
391 .SH "NOTES"
392 .IX Header "NOTES"
393 As noted, most of the verify options are for testing or debugging purposes.
394 Normally only the \fB\-CApath\fR, \fB\-CAfile\fR and (if the responder is a 'global
395 \&\s-1VA\s0') \fB\-VAfile\fR options need to be used.
396 .PP
397 The \s-1OCSP\s0 server is only useful for test and demonstration purposes: it is
398 not really usable as a full \s-1OCSP\s0 responder. It contains only a very
399 simple \s-1HTTP\s0 request handling and can only handle the \s-1POST\s0 form of \s-1OCSP\s0
400 queries. It also handles requests serially meaning it cannot respond to
401 new requests until it has processed the current one. The text index file
402 format of revocation is also inefficient for large quantities of revocation
403 data.
404 .PP
405 It is possible to run the \fBocsp\fR application in responder mode via a \s-1CGI\s0
406 script using the \fBrespin\fR and \fBrespout\fR options.
407 .SH "EXAMPLES"
408 .IX Header "EXAMPLES"
409 Create an \s-1OCSP\s0 request and write it to a file:
410 .PP
411 .Vb 1
412 \& openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout req.der
413 .Ve
414 Send a query to an \s-1OCSP\s0 responder with \s-1URL\s0 http://ocsp.myhost.com/ save the 
415 response to a file and print it out in text form
416 .PP
417 .Vb 2
418 \& openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e
419 \&     -url http://ocsp.myhost.com/ -resp_text -respout resp.der
420 .Ve
421 Read in an \s-1OCSP\s0 response and print out text form:
422 .PP
423 .Vb 1
424 \& openssl ocsp -respin resp.der -text
425 .Ve
426 \&\s-1OCSP\s0 server on port 8888 using a standard \fBca\fR configuration, and a separate
427 responder certificate. All requests and responses are printed to a file.
428 .PP
429 .Vb 2
430 \& openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
431 \&        -text -out log.txt
432 .Ve
433 As above but exit after processing one request:
434 .PP
435 .Vb 2
436 \& openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
437 \&     -nrequest 1
438 .Ve
439 Query status information using internally generated request:
440 .PP
441 .Vb 2
442 \& openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
443 \&     -issuer demoCA/cacert.pem -serial 1
444 .Ve
445 Query status information using request read from a file, write response to a
446 second file.
447 .PP
448 .Vb 2
449 \& openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
450 \&     -reqin req.der -respout resp.der
451 .Ve