Initial import from FreeBSD RELENG_4:
[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
4.\" Standard preamble:
5.\" ====================================================================== Sh \" Subsection heading
8.if t .Sp 5
13.. Sp \" Vertical space (when we can't use .PP)
15.if t .sp .5v
16.if n .sp
17.. Ip \" List item \\n(.$>=3 .ne \\$3
21.el .ne 3
22.IP "\\$1" \\$2
23.. Vb \" Begin verbatim text
25.ft CW \\$1
28.. Ve \" End verbatim text
30.ft R
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<> \(*W-|\(bv\*(Tr
41.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' 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' ""
53. ds -- \|\(em\|
54. ds PI \(*p
55. ds L" ``
56. ds R" ''
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"
67. nr % 0
68. rr F
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
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. 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
87.if t \{\
88. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
89. ds #V .6m
90. ds #F 0
91. ds #[ \&
92. ds #] \&
94. \" simple accents for nroff and troff
95.if n \{\
96. ds ' \&
97. ds ` \&
98. ds ^ \&
99. ds , \&
100. ds ~ ~
101. ds /
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'
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 \
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
137.rm #[ #] #H #V #F C
138.\" ======================================================================
140.IX Title "OCSP 1"
141.TH OCSP 1 "0.9.7a" "2003-02-19" "OpenSSL"
143.SH "NAME"
144ocsp \- Online Certificate Status Protocol utility
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]
155[\fB\-reqout file\fR]
156[\fB\-respout file\fR]
157[\fB\-reqin file\fR]
158[\fB\-respin file\fR]
161[\fB\-url responder_url\fR]
162[\fB\-host host:n\fR]
164[\fB\-CApath file\fR]
165[\fB\-CAfile file\fR]
166[\fB\-VAfile file\fR]
167[\fB\-verify_certs file\fR]
175[\fB\-validity_period nsec\fR]
176[\fB\-status_age nsec\fR]
179\&\fB\s-1WARNING:\s0 this documentation is preliminary and subject to change.\fR
181The Online Certificate Status Protocol (\s-1OCSP\s0) enables applications to
182determine the (revocation) state of an identified certificate (\s-1RFC\s0 2560).
184The \fBocsp\fR command performs many common \s-1OCSP\s0 tasks. It can be used
185to print out requests and responses, create requests and send queries
186to an \s-1OCSP\s0 responder and behave like a mini \s-1OCSP\s0 server itself.
189.Ip "\fB\-out filename\fR" 4
190.IX Item "-out filename"
191specify output filename, default is standard output.
192.Ip "\fB\-issuer filename\fR" 4
193.IX Item "-issuer filename"
194This specifies the current issuer certificate. This option can be used
195multiple 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"
199Add the certificate \fBfilename\fR to the request. The issuer certificate
200is taken from the previous \fBissuer\fR option, or an error occurs if no
201issuer certificate is specified.
202.Ip "\fB\-serial num\fR" 4
203.IX Item "-serial num"
204Same 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
206decimal integer unless preceded by \fB0x\fR. Negative integers can also
207be 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"
210Sign the \s-1OCSP\s0 request using the certificate specified in the \fBsigner\fR
211option and the private key specified by the \fBsignkey\fR option. If
212the \fBsignkey\fR option is not present then the private key is read
213from the same file as the certificate. If neither option is specified then
214the \s-1OCSP\s0 request is not signed.
215.Ip "\fB\-nonce\fR, \fB\-no_nonce\fR" 4
216.IX Item "-nonce, -no_nonce"
217Add an \s-1OCSP\s0 nonce extension to a request or disable \s-1OCSP\s0 nonce addition.
218Normally if an \s-1OCSP\s0 request is input using the \fBrespin\fR option no
219nonce is added: using the \fBnonce\fR option will force addition of a nonce.
220If an \s-1OCSP\s0 request is being created (using \fBcert\fR and \fBserial\fR options)
221a 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"
224print 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"
227write 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"
230read \s-1OCSP\s0 request or response file from \fBfile\fR. These option are ignored
231if \s-1OCSP\s0 request or response creation is implied by other options (for example
232with \fBserial\fR, \fBcert\fR and \fBhost\fR options).
233.Ip "\fB\-url responder_url\fR" 4
234.IX Item "-url responder_url"
235specify 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"
238if 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
240or \*(L"/\*(R" by default.
241.Ip "\fB\-CAfile file\fR, \fB\-CApath pathname\fR" 4
242.IX Item "-CAfile file, -CApath pathname"
243file or pathname containing trusted \s-1CA\s0 certificates. These are used to verify
244the signature on the \s-1OCSP\s0 response.
245.Ip "\fB\-verify_certs file\fR" 4
246.IX Item "-verify_certs file"
247file containing additional certificates to search when attempting to locate
248the \s-1OCSP\s0 response signing certificate. Some responders omit the actual signer's
249certificate from the response: this option can be used to supply the necessary
250certificate in such cases.
251.Ip "\fB\-trust_other\fR" 4
252.IX Item "-trust_other"
253the certificates specified by the \fB\-verify_certs\fR option should be explicitly
254trusted and no additional checks will be performed on them. This is useful
255when the complete responder certificate chain is not available or trusting a
256root \s-1CA\s0 is not appropriate.
257.Ip "\fB\-VAfile file\fR" 4
258.IX Item "-VAfile file"
259file 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"
263don't attempt to verify the \s-1OCSP\s0 response signature or the nonce values. This
264option will normally only be used for debugging since it disables all verification
265of the responders certificate.
266.Ip "\fB\-no_intern\fR" 4
267.IX Item "-no_intern"
268ignore certificates contained in the \s-1OCSP\s0 response when searching for the
269signers certificate. With this option the signers certificate must be specified
270with 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"
273don't check the signature on the \s-1OCSP\s0 response. Since this option tolerates invalid
274signatures 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"
277don't verify the \s-1OCSP\s0 response signers certificate at all. Since this option allows
278the \s-1OCSP\s0 response to be signed by any certificate it should only be used for
279testing purposes.
280.Ip "\fB\-no_chain\fR" 4
281.IX Item "-no_chain"
282do not use certificates in the response as additional untrusted \s-1CA\s0
284.Ip "\fB\-no_cert_checks\fR" 4
285.IX Item "-no_cert_checks"
286don't perform any additional checks on the \s-1OCSP\s0 response signers certificate.
287That is do not make any checks to see if the signers certificate is authorised
288to provide the necessary status information: as a result this option should
289only 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"
292these options specify the range of times, in seconds, which will be tolerated
293in an \s-1OCSP\s0 response. Each certificate status response includes a \fBnotBefore\fR time and
294an optional \fBnotAfter\fR time. The current time should fall between these two values, but
295the interval between the two times may be only a few seconds. In practice the \s-1OCSP\s0
296responder and clients clocks may not be precisely synchronised and so such a check
297may fail. To avoid this the \fB\-validity_period\fR option can be used to specify an
298acceptable error range in seconds, the default value is 5 minutes.
300If the \fBnotAfter\fR time is omitted from a response then this means that new status
301information is immediately available. In this case the age of the \fBnotBefore\fR field
302is checked to see it is not older than \fBage\fR seconds old. By default this additional
303check is not performed.
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
311If the \fBindex\fR option is specified the \fBocsp\fR utility is in responder mode, otherwise
312it is in client mode. The \fIrequest\fR\|(s) the responder processes can be either specified on
313the 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).
316If the \fBindex\fR option is present then the \fB\s-1CA\s0\fR and \fBrsigner\fR options must also be
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"
323The certificate to sign \s-1OCSP\s0 responses with.
324.Ip "\fB\-rother file\fR" 4
325.IX Item "-rother file"
326Additional certificates to include in the \s-1OCSP\s0 response.
327.Ip "\fB\-resp_no_certs\fR" 4
328.IX Item "-resp_no_certs"
329Don't include any certificates in the \s-1OCSP\s0 response.
330.Ip "\fB\-resp_key_id\fR" 4
331.IX Item "-resp_key_id"
332Identify 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"
335The 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"
339Port to listen for \s-1OCSP\s0 requests on. The port may also be specified using the \fBurl\fR
341.Ip "\fB\-nrequest number\fR" 4
342.IX Item "-nrequest number"
343The \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"
346Number 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
348omitted 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.
353Initially the \s-1OCSP\s0 responder certificate is located and the signature on
354the \s-1OCSP\s0 request checked using the responder certificate's public key.
356Then a normal certificate verify is performed on the \s-1OCSP\s0 responder certificate
357building up a certificate chain in the process. The locations of the trusted
358certificates used to build the chain can be specified by the \fBCAfile\fR
359and \fBCApath\fR options or they will be looked for in the standard OpenSSL
360certificates directory.
362If the initial verify fails then the \s-1OCSP\s0 verify process halts with an
365Otherwise the issuing \s-1CA\s0 certificate in the request is compared to the \s-1OCSP\s0
366responder certificate: if there is a match then the \s-1OCSP\s0 verify succeeds.
368Otherwise 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
370extended key usage is present in the \s-1OCSP\s0 responder certificate then the
371\&\s-1OCSP\s0 verify succeeds.
373Otherwise the root \s-1CA\s0 of the \s-1OCSP\s0 responders \s-1CA\s0 is checked to see if it
374is trusted for \s-1OCSP\s0 signing. If it is the \s-1OCSP\s0 verify succeeds.
376If none of these checks is successful then the \s-1OCSP\s0 verify fails.
378What this effectively means if that if the \s-1OCSP\s0 responder certificate is
379authorised directly by the \s-1CA\s0 it is issuing revocation information about
380(and it is correctly configured) then verification will succeed.
382If the \s-1OCSP\s0 responder is a \*(L"global responder\*(R" which can give details about
383multiple 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:
386.Vb 1
387\& openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem
389Alternatively the responder certificate itself can be explicitly trusted
390with the \fB\-VAfile\fR option.
391.SH "NOTES"
392.IX Header "NOTES"
393As noted, most of the verify options are for testing or debugging purposes.
394Normally 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.
397The \s-1OCSP\s0 server is only useful for test and demonstration purposes: it is
398not really usable as a full \s-1OCSP\s0 responder. It contains only a very
399simple \s-1HTTP\s0 request handling and can only handle the \s-1POST\s0 form of \s-1OCSP\s0
400queries. It also handles requests serially meaning it cannot respond to
401new requests until it has processed the current one. The text index file
402format of revocation is also inefficient for large quantities of revocation
405It is possible to run the \fBocsp\fR application in responder mode via a \s-1CGI\s0
406script using the \fBrespin\fR and \fBrespout\fR options.
408.IX Header "EXAMPLES"
409Create an \s-1OCSP\s0 request and write it to a file:
411.Vb 1
412\& openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout req.der
414Send a query to an \s-1OCSP\s0 responder with \s-1URL\s0 save the
415response to a file and print it out in text form
417.Vb 2
418\& openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e
419\& -url -resp_text -respout resp.der
421Read in an \s-1OCSP\s0 response and print out text form:
423.Vb 1
424\& openssl ocsp -respin resp.der -text
426\&\s-1OCSP\s0 server on port 8888 using a standard \fBca\fR configuration, and a separate
427responder certificate. All requests and responses are printed to a file.
429.Vb 2
430\& openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
431\& -text -out log.txt
433As above but exit after processing one request:
435.Vb 2
436\& openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
437\& -nrequest 1
439Query status information using internally generated request:
441.Vb 2
442\& openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
443\& -issuer demoCA/cacert.pem -serial 1
445Query status information using request read from a file, write response to a
446second file.
448.Vb 2
449\& openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
450\& -reqin req.der -respout resp.der