]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/usr.bin/openssl/man/ts.1
MFC: r325328
[FreeBSD/FreeBSD.git] / secure / usr.bin / openssl / man / ts.1
1 .\" Automatically generated by Pod::Man 4.07 (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 "2017-11-02" "1.0.2m" "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,
139 ts \- Time Stamping Authority tool (client/server)
140 .SH "SYNOPSIS"
141 .IX Header "SYNOPSIS"
142 \&\fBopenssl\fR \fBts\fR
143 \&\fB\-query\fR
144 [\fB\-rand\fR file:file...]
145 [\fB\-config\fR configfile]
146 [\fB\-data\fR file_to_hash]
147 [\fB\-digest\fR digest_bytes]
148 [\fB\-md2\fR|\fB\-md4\fR|\fB\-md5\fR|\fB\-sha\fR|\fB\-sha1\fR|\fB\-mdc2\fR|\fB\-ripemd160\fR|\fB...\fR]
149 [\fB\-policy\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 private.pem]
164 [\fB\-chain\fR certs_file.pem]
165 [\fB\-policy\fR object_id]
166 [\fB\-in\fR response.tsr]
167 [\fB\-token_in\fR]
168 [\fB\-out\fR response.tsr]
169 [\fB\-token_out\fR]
170 [\fB\-text\fR]
171 [\fB\-engine\fR id]
172 .PP
173 \&\fBopenssl\fR \fBts\fR
174 \&\fB\-verify\fR
175 [\fB\-data\fR file_to_hash]
176 [\fB\-digest\fR digest_bytes]
177 [\fB\-queryfile\fR request.tsq]
178 [\fB\-in\fR response.tsr]
179 [\fB\-token_in\fR]
180 [\fB\-CApath\fR trusted_cert_path]
181 [\fB\-CAfile\fR trusted_certs.pem]
182 [\fB\-untrusted\fR cert_file.pem]
183 .SH "DESCRIPTION"
184 .IX Header "DESCRIPTION"
185 The \fBts\fR command is a basic Time Stamping Authority (\s-1TSA\s0) client and server
186 application as specified in \s-1RFC 3161 \s0(Time-Stamp Protocol, \s-1TSP\s0). A
187 \&\s-1TSA\s0 can be part of a \s-1PKI\s0 deployment and its role is to provide long
188 term proof of the existence of a certain datum before a particular
189 time. Here is a brief description of the protocol:
190 .IP "1." 4
191 The \s-1TSA\s0 client computes a one-way hash value for a data file and sends
192 the hash to the \s-1TSA.\s0
193 .IP "2." 4
194 The \s-1TSA\s0 attaches the current date and time to the received hash value,
195 signs them and sends the time stamp token back to the client. By
196 creating this token the \s-1TSA\s0 certifies the existence of the original
197 data file at the time of response generation.
198 .IP "3." 4
199 The \s-1TSA\s0 client receives the time stamp token and verifies the
200 signature on it. It also checks if the token contains the same hash
201 value that it had sent to the \s-1TSA.\s0
202 .PP
203 There is one \s-1DER\s0 encoded protocol data unit defined for transporting a time
204 stamp request to the \s-1TSA\s0 and one for sending the time stamp response
205 back to the client. The \fBts\fR command has three main functions:
206 creating a time stamp request based on a data file,
207 creating a time stamp response based on a request, verifying if a
208 response corresponds to a particular request or a data file.
209 .PP
210 There is no support for sending the requests/responses automatically
211 over \s-1HTTP\s0 or \s-1TCP\s0 yet as suggested in \s-1RFC 3161.\s0 The users must send the
212 requests either by ftp or e\-mail.
213 .SH "OPTIONS"
214 .IX Header "OPTIONS"
215 .SS "Time Stamp Request generation"
216 .IX Subsection "Time Stamp Request generation"
217 The \fB\-query\fR switch can be used for creating and printing a time stamp
218 request with the following options:
219 .IP "\fB\-rand\fR file:file..." 4
220 .IX Item "-rand file:file..."
221 The files containing random data for seeding the random number
222 generator. Multiple files can be specified, the separator is \fB;\fR for
223 MS-Windows, \fB,\fR for \s-1VMS\s0 and \fB:\fR for all other platforms. (Optional)
224 .IP "\fB\-config\fR configfile" 4
225 .IX Item "-config configfile"
226 The configuration file to use, this option overrides the
227 \&\fB\s-1OPENSSL_CONF\s0\fR environment variable. Only the \s-1OID\s0 section
228 of the config file is used with the \fB\-query\fR command. (Optional)
229 .IP "\fB\-data\fR file_to_hash" 4
230 .IX Item "-data file_to_hash"
231 The data file for which the time stamp request needs to be
232 created. stdin is the default if neither the \fB\-data\fR nor the \fB\-digest\fR
233 parameter is specified. (Optional)
234 .IP "\fB\-digest\fR digest_bytes" 4
235 .IX Item "-digest digest_bytes"
236 It is possible to specify the message imprint explicitly without the data
237 file. The imprint must be specified in a hexadecimal format, two characters
238 per byte, the bytes optionally separated by colons (e.g. 1A:F6:01:... or
239 1AF601...). The number of bytes must match the message digest algorithm 
240 in use. (Optional)
241 .IP "\fB\-md2\fR|\fB\-md4\fR|\fB\-md5\fR|\fB\-sha\fR|\fB\-sha1\fR|\fB\-mdc2\fR|\fB\-ripemd160\fR|\fB...\fR" 4
242 .IX Item "-md2|-md4|-md5|-sha|-sha1|-mdc2|-ripemd160|..."
243 The message digest to apply to the data file, it supports all the message
244 digest algorithms that are supported by the openssl \fBdgst\fR command.
245 The default is \s-1SHA\-1. \s0(Optional)
246 .IP "\fB\-policy\fR object_id" 4
247 .IX Item "-policy object_id"
248 The policy that the client expects the \s-1TSA\s0 to use for creating the
249 time stamp token. Either the dotted \s-1OID\s0 notation or \s-1OID\s0 names defined
250 in the config file can be used. If no policy is requested the \s-1TSA\s0 will
251 use its own default policy. (Optional)
252 .IP "\fB\-no_nonce\fR" 4
253 .IX Item "-no_nonce"
254 No nonce is specified in the request if this option is
255 given. Otherwise a 64 bit long pseudo-random none is
256 included in the request. It is recommended to use nonce to
257 protect against replay-attacks. (Optional)
258 .IP "\fB\-cert\fR" 4
259 .IX Item "-cert"
260 The \s-1TSA\s0 is expected to include its signing certificate in the
261 response. (Optional)
262 .IP "\fB\-in\fR request.tsq" 4
263 .IX Item "-in request.tsq"
264 This option specifies a previously created time stamp request in \s-1DER\s0
265 format that will be printed into the output file. Useful when you need
266 to examine the content of a request in human-readable
267 .Sp
268 format. (Optional)
269 .IP "\fB\-out\fR request.tsq" 4
270 .IX Item "-out request.tsq"
271 Name of the output file to which the request will be written. Default
272 is stdout. (Optional)
273 .IP "\fB\-text\fR" 4
274 .IX Item "-text"
275 If this option is specified the output is human-readable text format
276 instead of \s-1DER. \s0(Optional)
277 .SS "Time Stamp Response generation"
278 .IX Subsection "Time Stamp Response generation"
279 A time stamp response (TimeStampResp) consists of a response status
280 and the time stamp token itself (ContentInfo), if the token generation was
281 successful. The \fB\-reply\fR command is for creating a time stamp
282 response or time stamp token based on a request and printing the
283 response/token in human-readable format. If \fB\-token_out\fR is not
284 specified the output is always a time stamp response (TimeStampResp),
285 otherwise it is a time stamp token (ContentInfo).
286 .IP "\fB\-config\fR configfile" 4
287 .IX Item "-config configfile"
288 The configuration file to use, this option overrides the
289 \&\fB\s-1OPENSSL_CONF\s0\fR environment variable. See \fB\s-1CONFIGURATION FILE
290 OPTIONS\s0\fR for configurable variables. (Optional)
291 .IP "\fB\-section\fR tsa_section" 4
292 .IX Item "-section tsa_section"
293 The name of the config file section conatining the settings for the
294 response generation. If not specified the default \s-1TSA\s0 section is
295 used, see \fB\s-1CONFIGURATION FILE OPTIONS\s0\fR for details. (Optional)
296 .IP "\fB\-queryfile\fR request.tsq" 4
297 .IX Item "-queryfile request.tsq"
298 The name of the file containing a \s-1DER\s0 encoded time stamp request. (Optional)
299 .IP "\fB\-passin\fR password_src" 4
300 .IX Item "-passin password_src"
301 Specifies the password source for the private key of the \s-1TSA.\s0 See
302 \&\fB\s-1PASS PHRASE ARGUMENTS\s0\fR in \fIopenssl\fR\|(1). (Optional)
303 .IP "\fB\-signer\fR tsa_cert.pem" 4
304 .IX Item "-signer tsa_cert.pem"
305 The signer certificate of the \s-1TSA\s0 in \s-1PEM\s0 format. The \s-1TSA\s0 signing
306 certificate must have exactly one extended key usage assigned to it:
307 timeStamping. The extended key usage must also be critical, otherwise
308 the certificate is going to be refused. Overrides the \fBsigner_cert\fR
309 variable of the config file. (Optional)
310 .IP "\fB\-inkey\fR private.pem" 4
311 .IX Item "-inkey private.pem"
312 The signer private key of the \s-1TSA\s0 in \s-1PEM\s0 format. Overrides the
313 \&\fBsigner_key\fR config file option. (Optional)
314 .IP "\fB\-chain\fR certs_file.pem" 4
315 .IX Item "-chain certs_file.pem"
316 The collection of certificates in \s-1PEM\s0 format that will all
317 be included in the response in addition to the signer certificate if
318 the \fB\-cert\fR option was used for the request. This file is supposed to
319 contain the certificate chain for the signer certificate from its
320 issuer upwards. The \fB\-reply\fR command does not build a certificate
321 chain automatically. (Optional)
322 .IP "\fB\-policy\fR object_id" 4
323 .IX Item "-policy object_id"
324 The default policy to use for the response unless the client
325 explicitly requires a particular \s-1TSA\s0 policy. The \s-1OID\s0 can be specified
326 either in dotted notation or with its name. Overrides the
327 \&\fBdefault_policy\fR config file option. (Optional)
328 .IP "\fB\-in\fR response.tsr" 4
329 .IX Item "-in response.tsr"
330 Specifies a previously created time stamp response or time stamp token
331 (if \fB\-token_in\fR is also specified) in \s-1DER\s0 format that will be written
332 to the output file. This option does not require a request, it is
333 useful e.g. when you need to examine the content of a response or
334 token or you want to extract the time stamp token from a response. If
335 the input is a token and the output is a time stamp response a default
336 \&'granted' status info is added to the token. (Optional)
337 .IP "\fB\-token_in\fR" 4
338 .IX Item "-token_in"
339 This flag can be used together with the \fB\-in\fR option and indicates
340 that the input is a \s-1DER\s0 encoded time stamp token (ContentInfo) instead
341 of a time stamp response (TimeStampResp). (Optional)
342 .IP "\fB\-out\fR response.tsr" 4
343 .IX Item "-out response.tsr"
344 The response is written to this file. The format and content of the
345 file depends on other options (see \fB\-text\fR, \fB\-token_out\fR). The default is
346 stdout. (Optional)
347 .IP "\fB\-token_out\fR" 4
348 .IX Item "-token_out"
349 The output is a time stamp token (ContentInfo) instead of time stamp
350 response (TimeStampResp). (Optional)
351 .IP "\fB\-text\fR" 4
352 .IX Item "-text"
353 If this option is specified the output is human-readable text format
354 instead of \s-1DER. \s0(Optional)
355 .IP "\fB\-engine\fR id" 4
356 .IX Item "-engine id"
357 Specifying an engine (by its unique \fBid\fR string) will cause \fBts\fR
358 to attempt to obtain a functional reference to the specified engine,
359 thus initialising it if needed. The engine will then be set as the default
360 for all available algorithms. Default is builtin. (Optional)
361 .SS "Time Stamp Response verification"
362 .IX Subsection "Time Stamp Response verification"
363 The \fB\-verify\fR command is for verifying if a time stamp response or time
364 stamp token is valid and matches a particular time stamp request or
365 data file. The \fB\-verify\fR command does not use the configuration file.
366 .IP "\fB\-data\fR file_to_hash" 4
367 .IX Item "-data file_to_hash"
368 The response or token must be verified against file_to_hash. The file
369 is hashed with the message digest algorithm specified in the token. 
370 The \fB\-digest\fR and \fB\-queryfile\fR options must not be specified with this one.
371 (Optional)
372 .IP "\fB\-digest\fR digest_bytes" 4
373 .IX Item "-digest digest_bytes"
374 The response or token must be verified against the message digest specified
375 with this option. The number of bytes must match the message digest algorithm
376 specified in the token. The \fB\-data\fR and \fB\-queryfile\fR options must not be
377 specified with this one. (Optional)
378 .IP "\fB\-queryfile\fR request.tsq" 4
379 .IX Item "-queryfile request.tsq"
380 The original time stamp request in \s-1DER\s0 format. The \fB\-data\fR and \fB\-digest\fR
381 options must not be specified with this one. (Optional)
382 .IP "\fB\-in\fR response.tsr" 4
383 .IX Item "-in response.tsr"
384 The time stamp response that needs to be verified in \s-1DER\s0 format. (Mandatory)
385 .IP "\fB\-token_in\fR" 4
386 .IX Item "-token_in"
387 This flag can be used together with the \fB\-in\fR option and indicates
388 that the input is a \s-1DER\s0 encoded time stamp token (ContentInfo) instead
389 of a time stamp response (TimeStampResp). (Optional)
390 .IP "\fB\-CApath\fR trusted_cert_path" 4
391 .IX Item "-CApath trusted_cert_path"
392 The name of the directory containing the trused \s-1CA\s0 certificates of the
393 client. See the similar option of \fIverify\fR\|(1) for additional
394 details. Either this option or \fB\-CAfile\fR must be specified. (Optional)
395 .IP "\fB\-CAfile\fR trusted_certs.pem" 4
396 .IX Item "-CAfile trusted_certs.pem"
397 The name of the file containing a set of trusted self-signed \s-1CA \s0
398 certificates in \s-1PEM\s0 format. See the similar option of 
399 \&\fIverify\fR\|(1) for additional details. Either this option 
400 or \fB\-CApath\fR must be specified.
401 (Optional)
402 .IP "\fB\-untrusted\fR cert_file.pem" 4
403 .IX Item "-untrusted cert_file.pem"
404 Set of additional untrusted certificates in \s-1PEM\s0 format which may be
405 needed when building the certificate chain for the \s-1TSA\s0's signing
406 certificate. This file must contain the \s-1TSA\s0 signing certificate and
407 all intermediate \s-1CA\s0 certificates unless the response includes them.
408 (Optional)
409 .SH "CONFIGURATION FILE OPTIONS"
410 .IX Header "CONFIGURATION FILE OPTIONS"
411 The \fB\-query\fR and \fB\-reply\fR commands make use of a configuration file
412 defined by the \fB\s-1OPENSSL_CONF\s0\fR environment variable. See \fIconfig\fR\|(5)
413 for a general description of the syntax of the config file. The
414 \&\fB\-query\fR command uses only the symbolic \s-1OID\s0 names section
415 and it can work without it. However, the \fB\-reply\fR command needs the
416 config file for its operation.
417 .PP
418 When there is a command line switch equivalent of a variable the
419 switch always overrides the settings in the config file.
420 .IP "\fBtsa\fR section, \fBdefault_tsa\fR" 4
421 .IX Item "tsa section, default_tsa"
422 This is the main section and it specifies the name of another section
423 that contains all the options for the \fB\-reply\fR command. This default
424 section can be overridden with the \fB\-section\fR command line switch. (Optional)
425 .IP "\fBoid_file\fR" 4
426 .IX Item "oid_file"
427 See \fIca\fR\|(1) for description. (Optional)
428 .IP "\fBoid_section\fR" 4
429 .IX Item "oid_section"
430 See \fIca\fR\|(1) for description. (Optional)
431 .IP "\fB\s-1RANDFILE\s0\fR" 4
432 .IX Item "RANDFILE"
433 See \fIca\fR\|(1) for description. (Optional)
434 .IP "\fBserial\fR" 4
435 .IX Item "serial"
436 The name of the file containing the hexadecimal serial number of the
437 last time stamp response created. This number is incremented by 1 for
438 each response. If the file does not exist at the time of response
439 generation a new file is created with serial number 1. (Mandatory)
440 .IP "\fBcrypto_device\fR" 4
441 .IX Item "crypto_device"
442 Specifies the OpenSSL engine that will be set as the default for 
443 all available algorithms. The default value is builtin, you can specify 
444 any other engines supported by OpenSSL (e.g. use chil for the NCipher \s-1HSM\s0).
445 (Optional)
446 .IP "\fBsigner_cert\fR" 4
447 .IX Item "signer_cert"
448 \&\s-1TSA\s0 signing certificate in \s-1PEM\s0 format. The same as the \fB\-signer\fR
449 command line option. (Optional)
450 .IP "\fBcerts\fR" 4
451 .IX Item "certs"
452 A file containing a set of \s-1PEM\s0 encoded certificates that need to be
453 included in the response. The same as the \fB\-chain\fR command line
454 option. (Optional)
455 .IP "\fBsigner_key\fR" 4
456 .IX Item "signer_key"
457 The private key of the \s-1TSA\s0 in \s-1PEM\s0 format. The same as the \fB\-inkey\fR
458 command line option. (Optional)
459 .IP "\fBdefault_policy\fR" 4
460 .IX Item "default_policy"
461 The default policy to use when the request does not mandate any
462 policy. The same as the \fB\-policy\fR command line option. (Optional)
463 .IP "\fBother_policies\fR" 4
464 .IX Item "other_policies"
465 Comma separated list of policies that are also acceptable by the \s-1TSA\s0
466 and used only if the request explicitly specifies one of them. (Optional)
467 .IP "\fBdigests\fR" 4
468 .IX Item "digests"
469 The list of message digest algorithms that the \s-1TSA\s0 accepts. At least
470 one algorithm must be specified. (Mandatory)
471 .IP "\fBaccuracy\fR" 4
472 .IX Item "accuracy"
473 The accuracy of the time source of the \s-1TSA\s0 in seconds, milliseconds
474 and microseconds. E.g. secs:1, millisecs:500, microsecs:100. If any of
475 the components is missing zero is assumed for that field. (Optional)
476 .IP "\fBclock_precision_digits\fR" 4
477 .IX Item "clock_precision_digits"
478 Specifies the maximum number of digits, which represent the fraction of 
479 seconds, that  need to be included in the time field. The trailing zeroes
480 must be removed from the time, so there might actually be fewer digits,
481 or no fraction of seconds at all. Supported only on \s-1UNIX\s0 platforms.
482 The maximum value is 6, default is 0.
483 (Optional)
484 .IP "\fBordering\fR" 4
485 .IX Item "ordering"
486 If this option is yes the responses generated by this \s-1TSA\s0 can always
487 be ordered, even if the time difference between two responses is less
488 than the sum of their accuracies. Default is no. (Optional)
489 .IP "\fBtsa_name\fR" 4
490 .IX Item "tsa_name"
491 Set this option to yes if the subject name of the \s-1TSA\s0 must be included in
492 the \s-1TSA\s0 name field of the response. Default is no. (Optional)
493 .IP "\fBess_cert_id_chain\fR" 4
494 .IX Item "ess_cert_id_chain"
495 The SignedData objects created by the \s-1TSA\s0 always contain the
496 certificate identifier of the signing certificate in a signed
497 attribute (see \s-1RFC 2634,\s0 Enhanced Security Services). If this option
498 is set to yes and either the \fBcerts\fR variable or the \fB\-chain\fR option
499 is specified then the certificate identifiers of the chain will also
500 be included in the SigningCertificate signed attribute. If this
501 variable is set to no, only the signing certificate identifier is
502 included. Default is no. (Optional)
503 .SH "ENVIRONMENT VARIABLES"
504 .IX Header "ENVIRONMENT VARIABLES"
505 \&\fB\s-1OPENSSL_CONF\s0\fR contains the path of the configuration file and can be
506 overridden by the \fB\-config\fR command line option.
507 .SH "EXAMPLES"
508 .IX Header "EXAMPLES"
509 All the examples below presume that \fB\s-1OPENSSL_CONF\s0\fR is set to a proper
510 configuration file, e.g. the example configuration file 
511 openssl/apps/openssl.cnf will do.
512 .SS "Time Stamp Request"
513 .IX Subsection "Time Stamp Request"
514 To create a time stamp request for design1.txt with \s-1SHA\-1 \s0
515 without nonce and policy and no certificate is required in the response:
516 .PP
517 .Vb 2
518 \&  openssl ts \-query \-data design1.txt \-no_nonce \e
519 \&        \-out design1.tsq
520 .Ve
521 .PP
522 To create a similar time stamp request with specifying the message imprint
523 explicitly:
524 .PP
525 .Vb 2
526 \&  openssl ts \-query \-digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \e
527 \&         \-no_nonce \-out design1.tsq
528 .Ve
529 .PP
530 To print the content of the previous request in human readable format:
531 .PP
532 .Vb 1
533 \&  openssl ts \-query \-in design1.tsq \-text
534 .Ve
535 .PP
536 To create a time stamp request which includes the \s-1MD\-5\s0 digest 
537 of design2.txt, requests the signer certificate and nonce,
538 specifies a policy id (assuming the tsa_policy1 name is defined in the
539 \&\s-1OID\s0 section of the config file):
540 .PP
541 .Vb 2
542 \&  openssl ts \-query \-data design2.txt \-md5 \e
543 \&        \-policy tsa_policy1 \-cert \-out design2.tsq
544 .Ve
545 .SS "Time Stamp Response"
546 .IX Subsection "Time Stamp Response"
547 Before generating a response a signing certificate must be created for
548 the \s-1TSA\s0 that contains the \fBtimeStamping\fR critical extended key usage extension
549 without any other key usage extensions. You can add the
550 \&'extendedKeyUsage = critical,timeStamping' line to the user certificate section
551 of the config file to generate a proper certificate. See \fIreq\fR\|(1),
552 \&\fIca\fR\|(1), \fIx509\fR\|(1) for instructions. The examples
553 below assume that cacert.pem contains the certificate of the \s-1CA,\s0
554 tsacert.pem is the signing certificate issued by cacert.pem and
555 tsakey.pem is the private key of the \s-1TSA.\s0
556 .PP
557 To create a time stamp response for a request:
558 .PP
559 .Vb 2
560 \&  openssl ts \-reply \-queryfile design1.tsq \-inkey tsakey.pem \e
561 \&        \-signer tsacert.pem \-out design1.tsr
562 .Ve
563 .PP
564 If you want to use the settings in the config file you could just write:
565 .PP
566 .Vb 1
567 \&  openssl ts \-reply \-queryfile design1.tsq \-out design1.tsr
568 .Ve
569 .PP
570 To print a time stamp reply to stdout in human readable format:
571 .PP
572 .Vb 1
573 \&  openssl ts \-reply \-in design1.tsr \-text
574 .Ve
575 .PP
576 To create a time stamp token instead of time stamp response:
577 .PP
578 .Vb 1
579 \&  openssl ts \-reply \-queryfile design1.tsq \-out design1_token.der \-token_out
580 .Ve
581 .PP
582 To print a time stamp token to stdout in human readable format:
583 .PP
584 .Vb 1
585 \&  openssl ts \-reply \-in design1_token.der \-token_in \-text \-token_out
586 .Ve
587 .PP
588 To extract the time stamp token from a response:
589 .PP
590 .Vb 1
591 \&  openssl ts \-reply \-in design1.tsr \-out design1_token.der \-token_out
592 .Ve
593 .PP
594 To add 'granted' status info to a time stamp token thereby creating a
595 valid response:
596 .PP
597 .Vb 1
598 \&  openssl ts \-reply \-in design1_token.der \-token_in \-out design1.tsr
599 .Ve
600 .SS "Time Stamp Verification"
601 .IX Subsection "Time Stamp Verification"
602 To verify a time stamp reply against a request:
603 .PP
604 .Vb 2
605 \&  openssl ts \-verify \-queryfile design1.tsq \-in design1.tsr \e
606 \&        \-CAfile cacert.pem \-untrusted tsacert.pem
607 .Ve
608 .PP
609 To verify a time stamp reply that includes the certificate chain:
610 .PP
611 .Vb 2
612 \&  openssl ts \-verify \-queryfile design2.tsq \-in design2.tsr \e
613 \&        \-CAfile cacert.pem
614 .Ve
615 .PP
616 To verify a time stamp token against the original data file:
617   openssl ts \-verify \-data design2.txt \-in design2.tsr \e
618         \-CAfile cacert.pem
619 .PP
620 To verify a time stamp token against a message imprint:
621   openssl ts \-verify \-digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \e
622          \-in design2.tsr \-CAfile cacert.pem
623 .PP
624 You could also look at the 'test' directory for more examples.
625 .SH "BUGS"
626 .IX Header "BUGS"
627 If you find any bugs or you have suggestions please write to
628 Zoltan Glozik <zglozik@opentsa.org>. Known issues:
629 .IP "\(bu" 4
630 No support for time stamps over \s-1SMTP,\s0 though it is quite easy
631 to implement an automatic e\-mail based \s-1TSA\s0 with \fIprocmail\fR\|(1) 
632 and \fIperl\fR\|(1). \s-1HTTP\s0 server support is provided in the form of 
633 a separate apache module. \s-1HTTP\s0 client support is provided by
634 \&\fItsget\fR\|(1). Pure \s-1TCP/IP\s0 protocol is not supported.
635 .IP "\(bu" 4
636 The file containing the last serial number of the \s-1TSA\s0 is not
637 locked when being read or written. This is a problem if more than one
638 instance of \fIopenssl\fR\|(1) is trying to create a time stamp
639 response at the same time. This is not an issue when using the apache
640 server module, it does proper locking.
641 .IP "\(bu" 4
642 Look for the \s-1FIXME\s0 word in the source files.
643 .IP "\(bu" 4
644 The source code should really be reviewed by somebody else, too.
645 .IP "\(bu" 4
646 More testing is needed, I have done only some basic tests (see
647 test/testtsa).
648 .SH "AUTHOR"
649 .IX Header "AUTHOR"
650 Zoltan Glozik <zglozik@opentsa.org>, OpenTSA project (http://www.opentsa.org)
651 .SH "SEE ALSO"
652 .IX Header "SEE ALSO"
653 \&\fItsget\fR\|(1), \fIopenssl\fR\|(1), \fIreq\fR\|(1), 
654 \&\fIx509\fR\|(1), \fIca\fR\|(1), \fIgenrsa\fR\|(1), 
655 \&\fIconfig\fR\|(5)