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