1 .\" $NetBSD: libcrypto.pl,v 1.3 2007/11/27 22:16:03 christos Exp $
3 .\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
6 .\" ========================================================================
7 .de Sh \" Subsection heading
15 .de Sp \" Vertical space (when we can't use .PP)
19 .de Vb \" Begin verbatim text
24 .de Ve \" End verbatim text
28 .\" Set up some character translations and predefined strings. \*(-- will
29 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
30 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
31 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
32 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
33 .\" nothing in troff, for use with C<>.
35 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
39 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
40 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
53 .\" Escape single quotes in literal strings from groff's Unicode transform.
57 .\" If the F register is turned on, we'll generate index entries on stderr for
58 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
59 .\" entries marked with X<> in POD. Of course, you'll have to process the
60 .\" output yourself in some meaningful fashion.
63 . tm Index:\\$1\t\\n%\t"\\$2"
73 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
74 .\" Fear. Run. Save yourself. No user-serviceable parts.
75 . \" fudge factors for nroff and troff
84 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
90 . \" simple accents for nroff and troff
100 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
101 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
102 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
103 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
104 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
105 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
107 . \" troff and (daisy-wheel) nroff accents
108 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
109 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
110 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
111 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
112 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
113 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
114 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
115 .ds ae a\h'-(\w'a'u*4/10)'e
116 .ds Ae A\h'-(\w'A'u*4/10)'E
117 . \" corrections for vroff
118 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
119 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
120 . \" for low resolution devices (crt and lpr)
121 .if \n(.H>23 .if \n(.V>19 \
134 .\" ========================================================================
137 .TH TS 1 "2009-04-15" "1.1.0-dev" "OpenSSL"
138 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
139 .\" way too many mistakes in technical documents.
143 ts \- Time Stamping Authority tool (client/server)
147 .IX Header "SYNOPSIS"
148 \&\fBopenssl\fR \fBts\fR
150 [\fB\-rand\fR file:file...]
151 [\fB\-config\fR configfile]
152 [\fB\-data\fR file_to_hash]
153 [\fB\-digest\fR digest_bytes]
154 [\fB\-md2\fR|\fB\-md4\fR|\fB\-md5\fR|\fB\-sha\fR|\fB\-sha1\fR|\fB\-mdc2\fR|\fB\-ripemd160\fR|\fB...\fR]
155 [\fB\-policy\fR object_id]
158 [\fB\-in\fR request.tsq]
159 [\fB\-out\fR request.tsq]
162 \&\fBopenssl\fR \fBts\fR
164 [\fB\-config\fR configfile]
165 [\fB\-section\fR tsa_section]
166 [\fB\-queryfile\fR request.tsq]
167 [\fB\-passin\fR password_src]
168 [\fB\-signer\fR tsa_cert.pem]
169 [\fB\-inkey\fR private.pem]
170 [\fB\-chain\fR certs_file.pem]
171 [\fB\-policy\fR object_id]
172 [\fB\-in\fR response.tsr]
174 [\fB\-out\fR response.tsr]
179 \&\fBopenssl\fR \fBts\fR
181 [\fB\-data\fR file_to_hash]
182 [\fB\-digest\fR digest_bytes]
183 [\fB\-queryfile\fR request.tsq]
184 [\fB\-in\fR response.tsr]
186 [\fB\-CApath\fR trusted_cert_path]
187 [\fB\-CAfile\fR trusted_certs.pem]
188 [\fB\-untrusted\fR cert_file.pem]
190 .IX Header "DESCRIPTION"
191 The \fBts\fR command is a basic Time Stamping Authority (\s-1TSA\s0) client and server
192 application as specified in \s-1RFC\s0 3161 (Time-Stamp Protocol, \s-1TSP\s0). A
193 \&\s-1TSA\s0 can be part of a \s-1PKI\s0 deployment and its role is to provide long
194 term proof of the existence of a certain datum before a particular
195 time. Here is a brief description of the protocol:
197 The \s-1TSA\s0 client computes a one-way hash value for a data file and sends
198 the hash to the \s-1TSA\s0.
200 The \s-1TSA\s0 attaches the current date and time to the received hash value,
201 signs them and sends the time stamp token back to the client. By
202 creating this token the \s-1TSA\s0 certifies the existence of the original
203 data file at the time of response generation.
205 The \s-1TSA\s0 client receives the time stamp token and verifies the
206 signature on it. It also checks if the token contains the same hash
207 value that it had sent to the \s-1TSA\s0.
209 There is one \s-1DER\s0 encoded protocol data unit defined for transporting a time
210 stamp request to the \s-1TSA\s0 and one for sending the time stamp response
211 back to the client. The \fBts\fR command has three main functions:
212 creating a time stamp request based on a data file,
213 creating a time stamp response based on a request, verifying if a
214 response corresponds to a particular request or a data file.
216 There is no support for sending the requests/responses automatically
217 over \s-1HTTP\s0 or \s-1TCP\s0 yet as suggested in \s-1RFC\s0 3161. The users must send the
218 requests either by ftp or e\-mail.
221 .Sh "Time Stamp Request generation"
222 .IX Subsection "Time Stamp Request generation"
223 The \fB\-query\fR switch can be used for creating and printing a time stamp
224 request with the following options:
225 .IP "\fB\-rand\fR file:file..." 4
226 .IX Item "-rand file:file..."
227 The files containing random data for seeding the random number
228 generator. Multiple files can be specified, the separator is \fB;\fR for
229 MS-Windows, \fB,\fR for \s-1VMS\s0 and \fB:\fR for all other platforms. (Optional)
230 .IP "\fB\-config\fR configfile" 4
231 .IX Item "-config configfile"
232 The configuration file to use, this option overrides the
233 \&\fB\s-1OPENSSL_CONF\s0\fR environment variable. Only the \s-1OID\s0 section
234 of the config file is used with the \fB\-query\fR command. (Optional)
235 .IP "\fB\-data\fR file_to_hash" 4
236 .IX Item "-data file_to_hash"
237 The data file for which the time stamp request needs to be
238 created. stdin is the default if neither the \fB\-data\fR nor the \fB\-digest\fR
239 parameter is specified. (Optional)
240 .IP "\fB\-digest\fR digest_bytes" 4
241 .IX Item "-digest digest_bytes"
242 It is possible to specify the message imprint explicitly without the data
243 file. The imprint must be specified in a hexadecimal format, two characters
244 per byte, the bytes optionally separated by colons (e.g. 1A:F6:01:... or
245 1AF601...). The number of bytes must match the message digest algorithm
247 .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
248 .IX Item "-md2|-md4|-md5|-sha|-sha1|-mdc2|-ripemd160|..."
249 The message digest to apply to the data file, it supports all the message
250 digest algorithms that are supported by the openssl \fBdgst\fR command.
251 The default is \s-1SHA\-1\s0. (Optional)
252 .IP "\fB\-policy\fR object_id" 4
253 .IX Item "-policy object_id"
254 The policy that the client expects the \s-1TSA\s0 to use for creating the
255 time stamp token. Either the dotted \s-1OID\s0 notation or \s-1OID\s0 names defined
256 in the config file can be used. If no policy is requested the \s-1TSA\s0 will
257 use its own default policy. (Optional)
258 .IP "\fB\-no_nonce\fR" 4
260 No nonce is specified in the request if this option is
261 given. Otherwise a 64 bit long pseudo-random none is
262 included in the request. It is recommended to use nonce to
263 protect against replay-attacks. (Optional)
266 The \s-1TSA\s0 is expected to include its signing certificate in the
268 .IP "\fB\-in\fR request.tsq" 4
269 .IX Item "-in request.tsq"
270 This option specifies a previously created time stamp request in \s-1DER\s0
271 format that will be printed into the output file. Useful when you need
272 to examine the content of a request in human-readable
275 .IP "\fB\-out\fR request.tsq" 4
276 .IX Item "-out request.tsq"
277 Name of the output file to which the request will be written. Default
278 is stdout. (Optional)
281 If this option is specified the output is human-readable text format
282 instead of \s-1DER\s0. (Optional)
283 .Sh "Time Stamp Response generation"
284 .IX Subsection "Time Stamp Response generation"
285 A time stamp response (TimeStampResp) consists of a response status
286 and the time stamp token itself (ContentInfo), if the token generation was
287 successful. The \fB\-reply\fR command is for creating a time stamp
288 response or time stamp token based on a request and printing the
289 response/token in human-readable format. If \fB\-token_out\fR is not
290 specified the output is always a time stamp response (TimeStampResp),
291 otherwise it is a time stamp token (ContentInfo).
292 .IP "\fB\-config\fR configfile" 4
293 .IX Item "-config configfile"
294 The configuration file to use, this option overrides the
295 \&\fB\s-1OPENSSL_CONF\s0\fR environment variable. See \fB\s-1CONFIGURATION\s0 \s-1FILE\s0
296 \&\s-1OPTIONS\s0\fR for configurable variables. (Optional)
297 .IP "\fB\-section\fR tsa_section" 4
298 .IX Item "-section tsa_section"
299 The name of the config file section conatining the settings for the
300 response generation. If not specified the default \s-1TSA\s0 section is
301 used, see \fB\s-1CONFIGURATION\s0 \s-1FILE\s0 \s-1OPTIONS\s0\fR for details. (Optional)
302 .IP "\fB\-queryfile\fR request.tsq" 4
303 .IX Item "-queryfile request.tsq"
304 The name of the file containing a \s-1DER\s0 encoded time stamp request. (Optional)
305 .IP "\fB\-passin\fR password_src" 4
306 .IX Item "-passin password_src"
307 Specifies the password source for the private key of the \s-1TSA\s0. See
308 \&\fB\s-1PASS\s0 \s-1PHRASE\s0 \s-1ARGUMENTS\s0\fR in \fIopenssl\fR\|(1). (Optional)
309 .IP "\fB\-signer\fR tsa_cert.pem" 4
310 .IX Item "-signer tsa_cert.pem"
311 The signer certificate of the \s-1TSA\s0 in \s-1PEM\s0 format. The \s-1TSA\s0 signing
312 certificate must have exactly one extended key usage assigned to it:
313 timeStamping. The extended key usage must also be critical, otherwise
314 the certificate is going to be refused. Overrides the \fBsigner_cert\fR
315 variable of the config file. (Optional)
316 .IP "\fB\-inkey\fR private.pem" 4
317 .IX Item "-inkey private.pem"
318 The signer private key of the \s-1TSA\s0 in \s-1PEM\s0 format. Overrides the
319 \&\fBsigner_key\fR config file option. (Optional)
320 .IP "\fB\-chain\fR certs_file.pem" 4
321 .IX Item "-chain certs_file.pem"
322 The collection of certificates in \s-1PEM\s0 format that will all
323 be included in the response in addition to the signer certificate if
324 the \fB\-cert\fR option was used for the request. This file is supposed to
325 contain the certificate chain for the signer certificate from its
326 issuer upwards. The \fB\-reply\fR command does not build a certificate
327 chain automatically. (Optional)
328 .IP "\fB\-policy\fR object_id" 4
329 .IX Item "-policy object_id"
330 The default policy to use for the response unless the client
331 explicitly requires a particular \s-1TSA\s0 policy. The \s-1OID\s0 can be specified
332 either in dotted notation or with its name. Overrides the
333 \&\fBdefault_policy\fR config file option. (Optional)
334 .IP "\fB\-in\fR response.tsr" 4
335 .IX Item "-in response.tsr"
336 Specifies a previously created time stamp response or time stamp token
337 (if \fB\-token_in\fR is also specified) in \s-1DER\s0 format that will be written
338 to the output file. This option does not require a request, it is
339 useful e.g. when you need to examine the content of a response or
340 token or you want to extract the time stamp token from a response. If
341 the input is a token and the output is a time stamp response a default
342 \&'granted' status info is added to the token. (Optional)
343 .IP "\fB\-token_in\fR" 4
345 This flag can be used together with the \fB\-in\fR option and indicates
346 that the input is a \s-1DER\s0 encoded time stamp token (ContentInfo) instead
347 of a time stamp response (TimeStampResp). (Optional)
348 .IP "\fB\-out\fR response.tsr" 4
349 .IX Item "-out response.tsr"
350 The response is written to this file. The format and content of the
351 file depends on other options (see \fB\-text\fR, \fB\-token_out\fR). The default is
353 .IP "\fB\-token_out\fR" 4
354 .IX Item "-token_out"
355 The output is a time stamp token (ContentInfo) instead of time stamp
356 response (TimeStampResp). (Optional)
359 If this option is specified the output is human-readable text format
360 instead of \s-1DER\s0. (Optional)
361 .IP "\fB\-engine\fR id" 4
362 .IX Item "-engine id"
363 Specifying an engine (by its unique \fBid\fR string) will cause \fBts\fR
364 to attempt to obtain a functional reference to the specified engine,
365 thus initialising it if needed. The engine will then be set as the default
366 for all available algorithms. Default is builtin. (Optional)
367 .Sh "Time Stamp Response verification"
368 .IX Subsection "Time Stamp Response verification"
369 The \fB\-verify\fR command is for verifying if a time stamp response or time
370 stamp token is valid and matches a particular time stamp request or
371 data file. The \fB\-verify\fR command does not use the configuration file.
372 .IP "\fB\-data\fR file_to_hash" 4
373 .IX Item "-data file_to_hash"
374 The response or token must be verified against file_to_hash. The file
375 is hashed with the message digest algorithm specified in the token.
376 The \fB\-digest\fR and \fB\-queryfile\fR options must not be specified with this one.
378 .IP "\fB\-digest\fR digest_bytes" 4
379 .IX Item "-digest digest_bytes"
380 The response or token must be verified against the message digest specified
381 with this option. The number of bytes must match the message digest algorithm
382 specified in the token. The \fB\-data\fR and \fB\-queryfile\fR options must not be
383 specified with this one. (Optional)
384 .IP "\fB\-queryfile\fR request.tsq" 4
385 .IX Item "-queryfile request.tsq"
386 The original time stamp request in \s-1DER\s0 format. The \fB\-data\fR and \fB\-digest\fR
387 options must not be specified with this one. (Optional)
388 .IP "\fB\-in\fR response.tsr" 4
389 .IX Item "-in response.tsr"
390 The time stamp response that needs to be verified in \s-1DER\s0 format. (Mandatory)
391 .IP "\fB\-token_in\fR" 4
393 This flag can be used together with the \fB\-in\fR option and indicates
394 that the input is a \s-1DER\s0 encoded time stamp token (ContentInfo) instead
395 of a time stamp response (TimeStampResp). (Optional)
396 .IP "\fB\-CApath\fR trusted_cert_path" 4
397 .IX Item "-CApath trusted_cert_path"
398 The name of the directory containing the trused \s-1CA\s0 certificates of the
399 client. See the similar option of \fIopenssl_verify\fR\|(1) for additional
400 details. Either this option or \fB\-CAfile\fR must be specified. (Optional)
401 .IP "\fB\-CAfile\fR trusted_certs.pem" 4
402 .IX Item "-CAfile trusted_certs.pem"
403 The name of the file containing a set of trusted self-signed \s-1CA\s0
404 certificates in \s-1PEM\s0 format. See the similar option of
405 \&\fIopenssl_verify\fR\|(1) for additional details. Either this option
406 or \fB\-CApath\fR must be specified.
408 .IP "\fB\-untrusted\fR cert_file.pem" 4
409 .IX Item "-untrusted cert_file.pem"
410 Set of additional untrusted certificates in \s-1PEM\s0 format which may be
411 needed when building the certificate chain for the \s-1TSA\s0's signing
412 certificate. This file must contain the \s-1TSA\s0 signing certificate and
413 all intermediate \s-1CA\s0 certificates unless the response includes them.
415 .SH "CONFIGURATION FILE OPTIONS"
416 .IX Header "CONFIGURATION FILE OPTIONS"
417 The \fB\-query\fR and \fB\-reply\fR commands make use of a configuration file
418 defined by the \fB\s-1OPENSSL_CONF\s0\fR environment variable. See \fIopenssl.cnf\fR\|(5)
419 for a general description of the syntax of the config file. The
420 \&\fB\-query\fR command uses only the symbolic \s-1OID\s0 names section
421 and it can work without it. However, the \fB\-reply\fR command needs the
422 config file for its operation.
424 When there is a command line switch equivalent of a variable the
425 switch always overrides the settings in the config file.
426 .IP "\fBtsa\fR section, \fBdefault_tsa\fR" 4
427 .IX Item "tsa section, default_tsa"
428 This is the main section and it specifies the name of another section
429 that contains all the options for the \fB\-reply\fR command. This default
430 section can be overriden with the \fB\-section\fR command line switch. (Optional)
431 .IP "\fBoid_file\fR" 4
433 See \fIopenssl_ca\fR\|(1) for description. (Optional)
434 .IP "\fBoid_section\fR" 4
435 .IX Item "oid_section"
436 See \fIopenssl_ca\fR\|(1) for description. (Optional)
437 .IP "\fB\s-1RANDFILE\s0\fR" 4
439 See \fIopenssl_ca\fR\|(1) for description. (Optional)
442 The name of the file containing the hexadecimal serial number of the
443 last time stamp response created. This number is incremented by 1 for
444 each response. If the file does not exist at the time of response
445 generation a new file is created with serial number 1. (Mandatory)
446 .IP "\fBcrypto_device\fR" 4
447 .IX Item "crypto_device"
448 Specifies the OpenSSL engine that will be set as the default for
449 all available algorithms. The default value is builtin, you can specify
450 any other engines supported by OpenSSL (e.g. use chil for the NCipher \s-1HSM\s0).
452 .IP "\fBsigner_cert\fR" 4
453 .IX Item "signer_cert"
454 \&\s-1TSA\s0 signing certificate in \s-1PEM\s0 format. The same as the \fB\-signer\fR
455 command line option. (Optional)
458 A file containing a set of \s-1PEM\s0 encoded certificates that need to be
459 included in the response. The same as the \fB\-chain\fR command line
461 .IP "\fBsigner_key\fR" 4
462 .IX Item "signer_key"
463 The private key of the \s-1TSA\s0 in \s-1PEM\s0 format. The same as the \fB\-inkey\fR
464 command line option. (Optional)
465 .IP "\fBdefault_policy\fR" 4
466 .IX Item "default_policy"
467 The default policy to use when the request does not mandate any
468 policy. The same as the \fB\-policy\fR command line option. (Optional)
469 .IP "\fBother_policies\fR" 4
470 .IX Item "other_policies"
471 Comma separated list of policies that are also acceptable by the \s-1TSA\s0
472 and used only if the request explicitly specifies one of them. (Optional)
473 .IP "\fBdigests\fR" 4
475 The list of message digest algorithms that the \s-1TSA\s0 accepts. At least
476 one algorithm must be specified. (Mandatory)
477 .IP "\fBaccuracy\fR" 4
479 The accuracy of the time source of the \s-1TSA\s0 in seconds, milliseconds
480 and microseconds. E.g. secs:1, millisecs:500, microsecs:100. If any of
481 the components is missing zero is assumed for that field. (Optional)
482 .IP "\fBclock_precision_digits\fR" 4
483 .IX Item "clock_precision_digits"
484 Specifies the maximum number of digits, which represent the fraction of
485 seconds, that need to be included in the time field. The trailing zeroes
486 must be removed from the time, so there might actually be fewer digits,
487 or no fraction of seconds at all. Supported only on \s-1UNIX\s0 platforms.
488 The maximum value is 6, default is 0.
490 .IP "\fBordering\fR" 4
492 If this option is yes the responses generated by this \s-1TSA\s0 can always
493 be ordered, even if the time difference between two responses is less
494 than the sum of their accuracies. Default is no. (Optional)
495 .IP "\fBtsa_name\fR" 4
497 Set this option to yes if the subject name of the \s-1TSA\s0 must be included in
498 the \s-1TSA\s0 name field of the response. Default is no. (Optional)
499 .IP "\fBess_cert_id_chain\fR" 4
500 .IX Item "ess_cert_id_chain"
501 The SignedData objects created by the \s-1TSA\s0 always contain the
502 certificate identifier of the signing certificate in a signed
503 attribute (see \s-1RFC\s0 2634, Enhanced Security Services). If this option
504 is set to yes and either the \fBcerts\fR variable or the \fB\-chain\fR option
505 is specified then the certificate identifiers of the chain will also
506 be included in the SigningCertificate signed attribute. If this
507 variable is set to no, only the signing certificate identifier is
508 included. Default is no. (Optional)
509 .SH "ENVIRONMENT VARIABLES"
510 .IX Header "ENVIRONMENT VARIABLES"
511 \&\fB\s-1OPENSSL_CONF\s0\fR contains the path of the configuration file and can be
512 overriden by the \fB\-config\fR command line option.
514 .IX Header "EXAMPLES"
515 All the examples below presume that \fB\s-1OPENSSL_CONF\s0\fR is set to a proper
516 configuration file, e.g. the example configuration file
517 openssl/apps/openssl.cnf will do.
518 .Sh "Time Stamp Request"
519 .IX Subsection "Time Stamp Request"
520 To create a time stamp request for design1.txt with \s-1SHA\-1\s0
521 without nonce and policy and no certificate is required in the response:
524 \& openssl ts \-query \-data design1.txt \-no_nonce \e
528 To create a similar time stamp request with specifying the message imprint
532 \& openssl ts \-query \-digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \e
533 \& \-no_nonce \-out design1.tsq
536 To print the content of the previous request in human readable format:
539 \& openssl ts \-query \-in design1.tsq \-text
542 To create a time stamp request which includes the \s-1MD\-5\s0 digest
543 of design2.txt, requests the signer certificate and nonce,
544 specifies a policy id (assuming the tsa_policy1 name is defined in the
545 \&\s-1OID\s0 section of the config file):
548 \& openssl ts \-query \-data design2.txt \-md5 \e
549 \& \-policy tsa_policy1 \-cert \-out design2.tsq
551 .Sh "Time Stamp Response"
552 .IX Subsection "Time Stamp Response"
553 Before generating a response a signing certificate must be created for
554 the \s-1TSA\s0 that contains the \fBtimeStamping\fR critical extended key usage extension
555 without any other key usage extensions. You can add the
556 \&'extendedKeyUsage = critical,timeStamping' line to the user certificate section
557 of the config file to generate a proper certificate. See \fIopenssl_req\fR\|(1),
558 \&\fIopenssl_ca\fR\|(1), \fIopenssl_x509\fR\|(1) for instructions. The examples
559 below assume that cacert.pem contains the certificate of the \s-1CA\s0,
560 tsacert.pem is the signing certificate issued by cacert.pem and
561 tsakey.pem is the private key of the \s-1TSA\s0.
563 To create a time stamp response for a request:
566 \& openssl ts \-reply \-queryfile design1.tsq \-inkey tsakey.pem \e
567 \& \-signer tsacert.pem \-out design1.tsr
570 If you want to use the settings in the config file you could just write:
573 \& openssl ts \-reply \-queryfile design1.tsq \-out design1.tsr
576 To print a time stamp reply to stdout in human readable format:
579 \& openssl ts \-reply \-in design1.tsr \-text
582 To create a time stamp token instead of time stamp response:
585 \& openssl ts \-reply \-queryfile design1.tsq \-out design1_token.der \-token_out
588 To print a time stamp token to stdout in human readable format:
591 \& openssl ts \-reply \-in design1_token.der \-token_in \-text \-token_out
594 To extract the time stamp token from a response:
597 \& openssl ts \-reply \-in design1.tsr \-out design1_token.der \-token_out
600 To add 'granted' status info to a time stamp token thereby creating a
604 \& openssl ts \-reply \-in design1_token.der \-token_in \-out design1.tsr
606 .Sh "Time Stamp Verification"
607 .IX Subsection "Time Stamp Verification"
608 To verify a time stamp reply against a request:
611 \& openssl ts \-verify \-queryfile design1.tsq \-in design1.tsr \e
612 \& \-CAfile cacert.pem \-untrusted tsacert.pem
615 To verify a time stamp reply that includes the certificate chain:
618 \& openssl ts \-verify \-queryfile design2.tsq \-in design2.tsr \e
619 \& \-CAfile cacert.pem
622 To verify a time stamp token against the original data file:
623 openssl ts \-verify \-data design2.txt \-in design2.tsr \e
626 To verify a time stamp token against a message imprint:
627 openssl ts \-verify \-digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \e
628 \-in design2.tsr \-CAfile cacert.pem
630 You could also look at the 'test' directory for more examples.
633 If you find any bugs or you have suggestions please write to
634 Zoltan Glozik <zglozik@opentsa.org>. Known issues:
636 No support for time stamps over \s-1SMTP\s0, though it is quite easy
637 to implement an automatic e\-mail based \s-1TSA\s0 with \fIprocmail\fR\|(1)
638 and \fIperl\fR\|(1). \s-1HTTP\s0 server support is provided in the form of
639 a separate apache module. \s-1HTTP\s0 client support is provided by
640 \&\fItsget\fR\|(1). Pure \s-1TCP/IP\s0 protocol is not supported.
642 The file containing the last serial number of the \s-1TSA\s0 is not
643 locked when being read or written. This is a problem if more than one
644 instance of \fIopenssl\fR\|(1) is trying to create a time stamp
645 response at the same time. This is not an issue when using the apache
646 server module, it does proper locking.
648 Look for the \s-1FIXME\s0 word in the source files.
650 The source code should really be reviewed by somebody else, too.
652 More testing is needed, I have done only some basic tests (see
656 Zoltan Glozik <zglozik@opentsa.org>, OpenTSA project (http://www.opentsa.org)
658 .IX Header "SEE ALSO"
659 \&\fItsget\fR\|(1), \fIopenssl\fR\|(1), \fIopenssl_req\fR\|(1),
660 \&\fIopenssl_x509\fR\|(1), \fIopenssl_ca\fR\|(1), \fIopenssl_genrsa\fR\|(1),
661 \&\fIopenssl.cnf\fR\|(5)