]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/usr.bin/openssl/man/ts.1
MFC: r340703
[FreeBSD/FreeBSD.git] / secure / usr.bin / openssl / man / ts.1
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "TS 1"
132 .TH TS 1 "2018-11-20" "1.1.1a" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 openssl\-ts, ts \- Time Stamping Authority tool (client/server)
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 \&\fBopenssl\fR \fBts\fR
142 \&\fB\-query\fR
143 [\fB\-rand file...\fR]
144 [\fB\-writerand file\fR]
145 [\fB\-config\fR configfile]
146 [\fB\-data\fR file_to_hash]
147 [\fB\-digest\fR digest_bytes]
148 [\fB\-\f(BIdigest\fB\fR]
149 [\fB\-tspolicy\fR object_id]
150 [\fB\-no_nonce\fR]
151 [\fB\-cert\fR]
152 [\fB\-in\fR request.tsq]
153 [\fB\-out\fR request.tsq]
154 [\fB\-text\fR]
155 .PP
156 \&\fBopenssl\fR \fBts\fR
157 \&\fB\-reply\fR
158 [\fB\-config\fR configfile]
159 [\fB\-section\fR tsa_section]
160 [\fB\-queryfile\fR request.tsq]
161 [\fB\-passin\fR password_src]
162 [\fB\-signer\fR tsa_cert.pem]
163 [\fB\-inkey\fR file_or_id]
164 [\fB\-\f(BIdigest\fB\fR]
165 [\fB\-chain\fR certs_file.pem]
166 [\fB\-tspolicy\fR object_id]
167 [\fB\-in\fR response.tsr]
168 [\fB\-token_in\fR]
169 [\fB\-out\fR response.tsr]
170 [\fB\-token_out\fR]
171 [\fB\-text\fR]
172 [\fB\-engine\fR id]
173 .PP
174 \&\fBopenssl\fR \fBts\fR
175 \&\fB\-verify\fR
176 [\fB\-data\fR file_to_hash]
177 [\fB\-digest\fR digest_bytes]
178 [\fB\-queryfile\fR request.tsq]
179 [\fB\-in\fR response.tsr]
180 [\fB\-token_in\fR]
181 [\fB\-CApath\fR trusted_cert_path]
182 [\fB\-CAfile\fR trusted_certs.pem]
183 [\fB\-untrusted\fR cert_file.pem]
184 [\fIverify options\fR]
185 .PP
186 \&\fIverify options:\fR
187 [\-attime timestamp]
188 [\-check_ss_sig]
189 [\-crl_check]
190 [\-crl_check_all]
191 [\-explicit_policy]
192 [\-extended_crl]
193 [\-ignore_critical]
194 [\-inhibit_any]
195 [\-inhibit_map]
196 [\-issuer_checks]
197 [\-no_alt_chains]
198 [\-no_check_time]
199 [\-partial_chain]
200 [\-policy arg]
201 [\-policy_check]
202 [\-policy_print]
203 [\-purpose purpose]
204 [\-suiteB_128]
205 [\-suiteB_128_only]
206 [\-suiteB_192]
207 [\-trusted_first]
208 [\-use_deltas]
209 [\-auth_level num]
210 [\-verify_depth num]
211 [\-verify_email email]
212 [\-verify_hostname hostname]
213 [\-verify_ip ip]
214 [\-verify_name name]
215 [\-x509_strict]
216 .SH "DESCRIPTION"
217 .IX Header "DESCRIPTION"
218 The \fBts\fR command is a basic Time Stamping Authority (\s-1TSA\s0) client and server
219 application as specified in \s-1RFC 3161\s0 (Time-Stamp Protocol, \s-1TSP\s0). A
220 \&\s-1TSA\s0 can be part of a \s-1PKI\s0 deployment and its role is to provide long
221 term proof of the existence of a certain datum before a particular
222 time. Here is a brief description of the protocol:
223 .IP "1." 4
224 The \s-1TSA\s0 client computes a one-way hash value for a data file and sends
225 the hash to the \s-1TSA.\s0
226 .IP "2." 4
227 The \s-1TSA\s0 attaches the current date and time to the received hash value,
228 signs them and sends the time stamp token back to the client. By
229 creating this token the \s-1TSA\s0 certifies the existence of the original
230 data file at the time of response generation.
231 .IP "3." 4
232 The \s-1TSA\s0 client receives the time stamp token and verifies the
233 signature on it. It also checks if the token contains the same hash
234 value that it had sent to the \s-1TSA.\s0
235 .PP
236 There is one \s-1DER\s0 encoded protocol data unit defined for transporting a time
237 stamp request to the \s-1TSA\s0 and one for sending the time stamp response
238 back to the client. The \fBts\fR command has three main functions:
239 creating a time stamp request based on a data file,
240 creating a time stamp response based on a request, verifying if a
241 response corresponds to a particular request or a data file.
242 .PP
243 There is no support for sending the requests/responses automatically
244 over \s-1HTTP\s0 or \s-1TCP\s0 yet as suggested in \s-1RFC 3161.\s0 The users must send the
245 requests either by ftp or e\-mail.
246 .SH "OPTIONS"
247 .IX Header "OPTIONS"
248 .SS "Time Stamp Request generation"
249 .IX Subsection "Time Stamp Request generation"
250 The \fB\-query\fR switch can be used for creating and printing a time stamp
251 request with the following options:
252 .IP "\fB\-rand file...\fR" 4
253 .IX Item "-rand file..."
254 A file or files containing random data used to seed the random number
255 generator.
256 Multiple files can be specified separated by an OS-dependent character.
257 The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
258 all others.
259 .IP "[\fB\-writerand file\fR]" 4
260 .IX Item "[-writerand file]"
261 Writes random data to the specified \fIfile\fR upon exit.
262 This can be used with a subsequent \fB\-rand\fR flag.
263 .IP "\fB\-config\fR configfile" 4
264 .IX Item "-config configfile"
265 The configuration file to use.
266 Optional; for a description of the default value,
267 see \*(L"\s-1COMMAND SUMMARY\*(R"\s0 in \fIopenssl\fR\|(1).
268 .IP "\fB\-data\fR file_to_hash" 4
269 .IX Item "-data file_to_hash"
270 The data file for which the time stamp request needs to be
271 created. stdin is the default if neither the \fB\-data\fR nor the \fB\-digest\fR
272 parameter is specified. (Optional)
273 .IP "\fB\-digest\fR digest_bytes" 4
274 .IX Item "-digest digest_bytes"
275 It is possible to specify the message imprint explicitly without the data
276 file. The imprint must be specified in a hexadecimal format, two characters
277 per byte, the bytes optionally separated by colons (e.g. 1A:F6:01:... or
278 1AF601...). The number of bytes must match the message digest algorithm
279 in use. (Optional)
280 .IP "\fB\-\f(BIdigest\fB\fR" 4
281 .IX Item "-digest"
282 The message digest to apply to the data file.
283 Any digest supported by the OpenSSL \fBdgst\fR command can be used.
284 The default is \s-1SHA\-1.\s0 (Optional)
285 .IP "\fB\-tspolicy\fR object_id" 4
286 .IX Item "-tspolicy object_id"
287 The policy that the client expects the \s-1TSA\s0 to use for creating the
288 time stamp token. Either the dotted \s-1OID\s0 notation or \s-1OID\s0 names defined
289 in the config file can be used. If no policy is requested the \s-1TSA\s0 will
290 use its own default policy. (Optional)
291 .IP "\fB\-no_nonce\fR" 4
292 .IX Item "-no_nonce"
293 No nonce is specified in the request if this option is
294 given. Otherwise a 64 bit long pseudo-random none is
295 included in the request. It is recommended to use nonce to
296 protect against replay-attacks. (Optional)
297 .IP "\fB\-cert\fR" 4
298 .IX Item "-cert"
299 The \s-1TSA\s0 is expected to include its signing certificate in the
300 response. (Optional)
301 .IP "\fB\-in\fR request.tsq" 4
302 .IX Item "-in request.tsq"
303 This option specifies a previously created time stamp request in \s-1DER\s0
304 format that will be printed into the output file. Useful when you need
305 to examine the content of a request in human-readable
306 format. (Optional)
307 .IP "\fB\-out\fR request.tsq" 4
308 .IX Item "-out request.tsq"
309 Name of the output file to which the request will be written. Default
310 is stdout. (Optional)
311 .IP "\fB\-text\fR" 4
312 .IX Item "-text"
313 If this option is specified the output is human-readable text format
314 instead of \s-1DER.\s0 (Optional)
315 .SS "Time Stamp Response generation"
316 .IX Subsection "Time Stamp Response generation"
317 A time stamp response (TimeStampResp) consists of a response status
318 and the time stamp token itself (ContentInfo), if the token generation was
319 successful. The \fB\-reply\fR command is for creating a time stamp
320 response or time stamp token based on a request and printing the
321 response/token in human-readable format. If \fB\-token_out\fR is not
322 specified the output is always a time stamp response (TimeStampResp),
323 otherwise it is a time stamp token (ContentInfo).
324 .IP "\fB\-config\fR configfile" 4
325 .IX Item "-config configfile"
326 The configuration file to use.
327 Optional; for a description of the default value,
328 see \*(L"\s-1COMMAND SUMMARY\*(R"\s0 in \fIopenssl\fR\|(1).
329 See \fB\s-1CONFIGURATION FILE OPTIONS\s0\fR for configurable variables.
330 .IP "\fB\-section\fR tsa_section" 4
331 .IX Item "-section tsa_section"
332 The name of the config file section containing the settings for the
333 response generation. If not specified the default \s-1TSA\s0 section is
334 used, see \fB\s-1CONFIGURATION FILE OPTIONS\s0\fR for details. (Optional)
335 .IP "\fB\-queryfile\fR request.tsq" 4
336 .IX Item "-queryfile request.tsq"
337 The name of the file containing a \s-1DER\s0 encoded time stamp request. (Optional)
338 .IP "\fB\-passin\fR password_src" 4
339 .IX Item "-passin password_src"
340 Specifies the password source for the private key of the \s-1TSA.\s0 See
341 \&\fB\s-1PASS PHRASE ARGUMENTS\s0\fR in \fIopenssl\fR\|(1). (Optional)
342 .IP "\fB\-signer\fR tsa_cert.pem" 4
343 .IX Item "-signer tsa_cert.pem"
344 The signer certificate of the \s-1TSA\s0 in \s-1PEM\s0 format. The \s-1TSA\s0 signing
345 certificate must have exactly one extended key usage assigned to it:
346 timeStamping. The extended key usage must also be critical, otherwise
347 the certificate is going to be refused. Overrides the \fBsigner_cert\fR
348 variable of the config file. (Optional)
349 .IP "\fB\-inkey\fR file_or_id" 4
350 .IX Item "-inkey file_or_id"
351 The signer private key of the \s-1TSA\s0 in \s-1PEM\s0 format. Overrides the
352 \&\fBsigner_key\fR config file option. (Optional)
353 If no engine is used, the argument is taken as a file; if an engine is
354 specified, the argument is given to the engine as a key identifier.
355 .IP "\fB\-\f(BIdigest\fB\fR" 4
356 .IX Item "-digest"
357 Signing digest to use. Overrides the \fBsigner_digest\fR config file
358 option. (Optional)
359 .IP "\fB\-chain\fR certs_file.pem" 4
360 .IX Item "-chain certs_file.pem"
361 The collection of certificates in \s-1PEM\s0 format that will all
362 be included in the response in addition to the signer certificate if
363 the \fB\-cert\fR option was used for the request. This file is supposed to
364 contain the certificate chain for the signer certificate from its
365 issuer upwards. The \fB\-reply\fR command does not build a certificate
366 chain automatically. (Optional)
367 .IP "\fB\-tspolicy\fR object_id" 4
368 .IX Item "-tspolicy object_id"
369 The default policy to use for the response unless the client
370 explicitly requires a particular \s-1TSA\s0 policy. The \s-1OID\s0 can be specified
371 either in dotted notation or with its name. Overrides the
372 \&\fBdefault_policy\fR config file option. (Optional)
373 .IP "\fB\-in\fR response.tsr" 4
374 .IX Item "-in response.tsr"
375 Specifies a previously created time stamp response or time stamp token
376 (if \fB\-token_in\fR is also specified) in \s-1DER\s0 format that will be written
377 to the output file. This option does not require a request, it is
378 useful e.g. when you need to examine the content of a response or
379 token or you want to extract the time stamp token from a response. If
380 the input is a token and the output is a time stamp response a default
381 \&'granted' status info is added to the token. (Optional)
382 .IP "\fB\-token_in\fR" 4
383 .IX Item "-token_in"
384 This flag can be used together with the \fB\-in\fR option and indicates
385 that the input is a \s-1DER\s0 encoded time stamp token (ContentInfo) instead
386 of a time stamp response (TimeStampResp). (Optional)
387 .IP "\fB\-out\fR response.tsr" 4
388 .IX Item "-out response.tsr"
389 The response is written to this file. The format and content of the
390 file depends on other options (see \fB\-text\fR, \fB\-token_out\fR). The default is
391 stdout. (Optional)
392 .IP "\fB\-token_out\fR" 4
393 .IX Item "-token_out"
394 The output is a time stamp token (ContentInfo) instead of time stamp
395 response (TimeStampResp). (Optional)
396 .IP "\fB\-text\fR" 4
397 .IX Item "-text"
398 If this option is specified the output is human-readable text format
399 instead of \s-1DER.\s0 (Optional)
400 .IP "\fB\-engine\fR id" 4
401 .IX Item "-engine id"
402 Specifying an engine (by its unique \fBid\fR string) will cause \fBts\fR
403 to attempt to obtain a functional reference to the specified engine,
404 thus initialising it if needed. The engine will then be set as the default
405 for all available algorithms. Default is builtin. (Optional)
406 .SS "Time Stamp Response verification"
407 .IX Subsection "Time Stamp Response verification"
408 The \fB\-verify\fR command is for verifying if a time stamp response or time
409 stamp token is valid and matches a particular time stamp request or
410 data file. The \fB\-verify\fR command does not use the configuration file.
411 .IP "\fB\-data\fR file_to_hash" 4
412 .IX Item "-data file_to_hash"
413 The response or token must be verified against file_to_hash. The file
414 is hashed with the message digest algorithm specified in the token.
415 The \fB\-digest\fR and \fB\-queryfile\fR options must not be specified with this one.
416 (Optional)
417 .IP "\fB\-digest\fR digest_bytes" 4
418 .IX Item "-digest digest_bytes"
419 The response or token must be verified against the message digest specified
420 with this option. The number of bytes must match the message digest algorithm
421 specified in the token. The \fB\-data\fR and \fB\-queryfile\fR options must not be
422 specified with this one. (Optional)
423 .IP "\fB\-queryfile\fR request.tsq" 4
424 .IX Item "-queryfile request.tsq"
425 The original time stamp request in \s-1DER\s0 format. The \fB\-data\fR and \fB\-digest\fR
426 options must not be specified with this one. (Optional)
427 .IP "\fB\-in\fR response.tsr" 4
428 .IX Item "-in response.tsr"
429 The time stamp response that needs to be verified in \s-1DER\s0 format. (Mandatory)
430 .IP "\fB\-token_in\fR" 4
431 .IX Item "-token_in"
432 This flag can be used together with the \fB\-in\fR option and indicates
433 that the input is a \s-1DER\s0 encoded time stamp token (ContentInfo) instead
434 of a time stamp response (TimeStampResp). (Optional)
435 .IP "\fB\-CApath\fR trusted_cert_path" 4
436 .IX Item "-CApath trusted_cert_path"
437 The name of the directory containing the trusted \s-1CA\s0 certificates of the
438 client. See the similar option of \fIverify\fR\|(1) for additional
439 details. Either this option or \fB\-CAfile\fR must be specified. (Optional)
440 .IP "\fB\-CAfile\fR trusted_certs.pem" 4
441 .IX Item "-CAfile trusted_certs.pem"
442 The name of the file containing a set of trusted self-signed \s-1CA\s0
443 certificates in \s-1PEM\s0 format. See the similar option of
444 \&\fIverify\fR\|(1) for additional details. Either this option
445 or \fB\-CApath\fR must be specified.
446 (Optional)
447 .IP "\fB\-untrusted\fR cert_file.pem" 4
448 .IX Item "-untrusted cert_file.pem"
449 Set of additional untrusted certificates in \s-1PEM\s0 format which may be
450 needed when building the certificate chain for the \s-1TSA\s0's signing
451 certificate. This file must contain the \s-1TSA\s0 signing certificate and
452 all intermediate \s-1CA\s0 certificates unless the response includes them.
453 (Optional)
454 .IP "\fIverify options\fR" 4
455 .IX Item "verify options"
456 The options \fB\-attime timestamp\fR, \fB\-check_ss_sig\fR, \fB\-crl_check\fR,
457 \&\fB\-crl_check_all\fR, \fB\-explicit_policy\fR, \fB\-extended_crl\fR, \fB\-ignore_critical\fR,
458 \&\fB\-inhibit_any\fR, \fB\-inhibit_map\fR, \fB\-issuer_checks\fR, \fB\-no_alt_chains\fR,
459 \&\fB\-no_check_time\fR, \fB\-partial_chain\fR, \fB\-policy\fR, \fB\-policy_check\fR,
460 \&\fB\-policy_print\fR, \fB\-purpose\fR, \fB\-suiteB_128\fR, \fB\-suiteB_128_only\fR,
461 \&\fB\-suiteB_192\fR, \fB\-trusted_first\fR, \fB\-use_deltas\fR, \fB\-auth_level\fR,
462 \&\fB\-verify_depth\fR, \fB\-verify_email\fR, \fB\-verify_hostname\fR, \fB\-verify_ip\fR,
463 \&\fB\-verify_name\fR, and \fB\-x509_strict\fR can be used to control timestamp
464 verification.  See \fIverify\fR\|(1).
465 .SH "CONFIGURATION FILE OPTIONS"
466 .IX Header "CONFIGURATION FILE OPTIONS"
467 The \fB\-query\fR and \fB\-reply\fR commands make use of a configuration file.
468 See \fIconfig\fR\|(5)
469 for a general description of the syntax of the config file. The
470 \&\fB\-query\fR command uses only the symbolic \s-1OID\s0 names section
471 and it can work without it. However, the \fB\-reply\fR command needs the
472 config file for its operation.
473 .PP
474 When there is a command line switch equivalent of a variable the
475 switch always overrides the settings in the config file.
476 .IP "\fBtsa\fR section, \fBdefault_tsa\fR" 4
477 .IX Item "tsa section, default_tsa"
478 This is the main section and it specifies the name of another section
479 that contains all the options for the \fB\-reply\fR command. This default
480 section can be overridden with the \fB\-section\fR command line switch. (Optional)
481 .IP "\fBoid_file\fR" 4
482 .IX Item "oid_file"
483 See \fIca\fR\|(1) for description. (Optional)
484 .IP "\fBoid_section\fR" 4
485 .IX Item "oid_section"
486 See \fIca\fR\|(1) for description. (Optional)
487 .IP "\fB\s-1RANDFILE\s0\fR" 4
488 .IX Item "RANDFILE"
489 See \fIca\fR\|(1) for description. (Optional)
490 .IP "\fBserial\fR" 4
491 .IX Item "serial"
492 The name of the file containing the hexadecimal serial number of the
493 last time stamp response created. This number is incremented by 1 for
494 each response. If the file does not exist at the time of response
495 generation a new file is created with serial number 1. (Mandatory)
496 .IP "\fBcrypto_device\fR" 4
497 .IX Item "crypto_device"
498 Specifies the OpenSSL engine that will be set as the default for
499 all available algorithms. The default value is builtin, you can specify
500 any other engines supported by OpenSSL (e.g. use chil for the NCipher \s-1HSM\s0).
501 (Optional)
502 .IP "\fBsigner_cert\fR" 4
503 .IX Item "signer_cert"
504 \&\s-1TSA\s0 signing certificate in \s-1PEM\s0 format. The same as the \fB\-signer\fR
505 command line option. (Optional)
506 .IP "\fBcerts\fR" 4
507 .IX Item "certs"
508 A file containing a set of \s-1PEM\s0 encoded certificates that need to be
509 included in the response. The same as the \fB\-chain\fR command line
510 option. (Optional)
511 .IP "\fBsigner_key\fR" 4
512 .IX Item "signer_key"
513 The private key of the \s-1TSA\s0 in \s-1PEM\s0 format. The same as the \fB\-inkey\fR
514 command line option. (Optional)
515 .IP "\fBsigner_digest\fR" 4
516 .IX Item "signer_digest"
517 Signing digest to use. The same as the
518 \&\fB\-\f(BIdigest\fB\fR command line option. (Optional)
519 .IP "\fBdefault_policy\fR" 4
520 .IX Item "default_policy"
521 The default policy to use when the request does not mandate any
522 policy. The same as the \fB\-tspolicy\fR command line option. (Optional)
523 .IP "\fBother_policies\fR" 4
524 .IX Item "other_policies"
525 Comma separated list of policies that are also acceptable by the \s-1TSA\s0
526 and used only if the request explicitly specifies one of them. (Optional)
527 .IP "\fBdigests\fR" 4
528 .IX Item "digests"
529 The list of message digest algorithms that the \s-1TSA\s0 accepts. At least
530 one algorithm must be specified. (Mandatory)
531 .IP "\fBaccuracy\fR" 4
532 .IX Item "accuracy"
533 The accuracy of the time source of the \s-1TSA\s0 in seconds, milliseconds
534 and microseconds. E.g. secs:1, millisecs:500, microsecs:100. If any of
535 the components is missing zero is assumed for that field. (Optional)
536 .IP "\fBclock_precision_digits\fR" 4
537 .IX Item "clock_precision_digits"
538 Specifies the maximum number of digits, which represent the fraction of
539 seconds, that  need to be included in the time field. The trailing zeroes
540 must be removed from the time, so there might actually be fewer digits,
541 or no fraction of seconds at all. Supported only on \s-1UNIX\s0 platforms.
542 The maximum value is 6, default is 0.
543 (Optional)
544 .IP "\fBordering\fR" 4
545 .IX Item "ordering"
546 If this option is yes the responses generated by this \s-1TSA\s0 can always
547 be ordered, even if the time difference between two responses is less
548 than the sum of their accuracies. Default is no. (Optional)
549 .IP "\fBtsa_name\fR" 4
550 .IX Item "tsa_name"
551 Set this option to yes if the subject name of the \s-1TSA\s0 must be included in
552 the \s-1TSA\s0 name field of the response. Default is no. (Optional)
553 .IP "\fBess_cert_id_chain\fR" 4
554 .IX Item "ess_cert_id_chain"
555 The SignedData objects created by the \s-1TSA\s0 always contain the
556 certificate identifier of the signing certificate in a signed
557 attribute (see \s-1RFC 2634,\s0 Enhanced Security Services). If this option
558 is set to yes and either the \fBcerts\fR variable or the \fB\-chain\fR option
559 is specified then the certificate identifiers of the chain will also
560 be included in the SigningCertificate signed attribute. If this
561 variable is set to no, only the signing certificate identifier is
562 included. Default is no. (Optional)
563 .IP "\fBess_cert_id_alg\fR" 4
564 .IX Item "ess_cert_id_alg"
565 This option specifies the hash function to be used to calculate the \s-1TSA\s0's
566 public key certificate identifier. Default is sha1. (Optional)
567 .SH "EXAMPLES"
568 .IX Header "EXAMPLES"
569 All the examples below presume that \fB\s-1OPENSSL_CONF\s0\fR is set to a proper
570 configuration file, e.g. the example configuration file
571 openssl/apps/openssl.cnf will do.
572 .SS "Time Stamp Request"
573 .IX Subsection "Time Stamp Request"
574 To create a time stamp request for design1.txt with \s-1SHA\-1\s0
575 without nonce and policy and no certificate is required in the response:
576 .PP
577 .Vb 2
578 \&  openssl ts \-query \-data design1.txt \-no_nonce \e
579 \&        \-out design1.tsq
580 .Ve
581 .PP
582 To create a similar time stamp request with specifying the message imprint
583 explicitly:
584 .PP
585 .Vb 2
586 \&  openssl ts \-query \-digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \e
587 \&         \-no_nonce \-out design1.tsq
588 .Ve
589 .PP
590 To print the content of the previous request in human readable format:
591 .PP
592 .Vb 1
593 \&  openssl ts \-query \-in design1.tsq \-text
594 .Ve
595 .PP
596 To create a time stamp request which includes the \s-1MD\-5\s0 digest
597 of design2.txt, requests the signer certificate and nonce,
598 specifies a policy id (assuming the tsa_policy1 name is defined in the
599 \&\s-1OID\s0 section of the config file):
600 .PP
601 .Vb 2
602 \&  openssl ts \-query \-data design2.txt \-md5 \e
603 \&        \-tspolicy tsa_policy1 \-cert \-out design2.tsq
604 .Ve
605 .SS "Time Stamp Response"
606 .IX Subsection "Time Stamp Response"
607 Before generating a response a signing certificate must be created for
608 the \s-1TSA\s0 that contains the \fBtimeStamping\fR critical extended key usage extension
609 without any other key usage extensions. You can add this line to the
610 user certificate section of the config file to generate a proper certificate;
611 .PP
612 .Vb 1
613 \&   extendedKeyUsage = critical,timeStamping
614 .Ve
615 .PP
616 See \fIreq\fR\|(1), \fIca\fR\|(1), and \fIx509\fR\|(1) for instructions. The examples
617 below assume that cacert.pem contains the certificate of the \s-1CA,\s0
618 tsacert.pem is the signing certificate issued by cacert.pem and
619 tsakey.pem is the private key of the \s-1TSA.\s0
620 .PP
621 To create a time stamp response for a request:
622 .PP
623 .Vb 2
624 \&  openssl ts \-reply \-queryfile design1.tsq \-inkey tsakey.pem \e
625 \&        \-signer tsacert.pem \-out design1.tsr
626 .Ve
627 .PP
628 If you want to use the settings in the config file you could just write:
629 .PP
630 .Vb 1
631 \&  openssl ts \-reply \-queryfile design1.tsq \-out design1.tsr
632 .Ve
633 .PP
634 To print a time stamp reply to stdout in human readable format:
635 .PP
636 .Vb 1
637 \&  openssl ts \-reply \-in design1.tsr \-text
638 .Ve
639 .PP
640 To create a time stamp token instead of time stamp response:
641 .PP
642 .Vb 1
643 \&  openssl ts \-reply \-queryfile design1.tsq \-out design1_token.der \-token_out
644 .Ve
645 .PP
646 To print a time stamp token to stdout in human readable format:
647 .PP
648 .Vb 1
649 \&  openssl ts \-reply \-in design1_token.der \-token_in \-text \-token_out
650 .Ve
651 .PP
652 To extract the time stamp token from a response:
653 .PP
654 .Vb 1
655 \&  openssl ts \-reply \-in design1.tsr \-out design1_token.der \-token_out
656 .Ve
657 .PP
658 To add 'granted' status info to a time stamp token thereby creating a
659 valid response:
660 .PP
661 .Vb 1
662 \&  openssl ts \-reply \-in design1_token.der \-token_in \-out design1.tsr
663 .Ve
664 .SS "Time Stamp Verification"
665 .IX Subsection "Time Stamp Verification"
666 To verify a time stamp reply against a request:
667 .PP
668 .Vb 2
669 \&  openssl ts \-verify \-queryfile design1.tsq \-in design1.tsr \e
670 \&        \-CAfile cacert.pem \-untrusted tsacert.pem
671 .Ve
672 .PP
673 To verify a time stamp reply that includes the certificate chain:
674 .PP
675 .Vb 2
676 \&  openssl ts \-verify \-queryfile design2.tsq \-in design2.tsr \e
677 \&        \-CAfile cacert.pem
678 .Ve
679 .PP
680 To verify a time stamp token against the original data file:
681   openssl ts \-verify \-data design2.txt \-in design2.tsr \e
682         \-CAfile cacert.pem
683 .PP
684 To verify a time stamp token against a message imprint:
685   openssl ts \-verify \-digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \e
686          \-in design2.tsr \-CAfile cacert.pem
687 .PP
688 You could also look at the 'test' directory for more examples.
689 .SH "BUGS"
690 .IX Header "BUGS"
691 .IP "\(bu" 2
692 No support for time stamps over \s-1SMTP,\s0 though it is quite easy
693 to implement an automatic e\-mail based \s-1TSA\s0 with \fIprocmail\fR\|(1)
694 and \fIperl\fR\|(1). \s-1HTTP\s0 server support is provided in the form of
695 a separate apache module. \s-1HTTP\s0 client support is provided by
696 \&\fItsget\fR\|(1). Pure \s-1TCP/IP\s0 protocol is not supported.
697 .IP "\(bu" 2
698 The file containing the last serial number of the \s-1TSA\s0 is not
699 locked when being read or written. This is a problem if more than one
700 instance of \fIopenssl\fR\|(1) is trying to create a time stamp
701 response at the same time. This is not an issue when using the apache
702 server module, it does proper locking.
703 .IP "\(bu" 2
704 Look for the \s-1FIXME\s0 word in the source files.
705 .IP "\(bu" 2
706 The source code should really be reviewed by somebody else, too.
707 .IP "\(bu" 2
708 More testing is needed, I have done only some basic tests (see
709 test/testtsa).
710 .SH "SEE ALSO"
711 .IX Header "SEE ALSO"
712 \&\fItsget\fR\|(1), \fIopenssl\fR\|(1), \fIreq\fR\|(1),
713 \&\fIx509\fR\|(1), \fIca\fR\|(1), \fIgenrsa\fR\|(1),
714 \&\fIconfig\fR\|(5)
715 .SH "COPYRIGHT"
716 .IX Header "COPYRIGHT"
717 Copyright 2006\-2018 The OpenSSL Project Authors. All Rights Reserved.
718 .PP
719 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
720 this file except in compliance with the License.  You can obtain a copy
721 in the file \s-1LICENSE\s0 in the source distribution or at
722 <https://www.openssl.org/source/license.html>.