| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | =pod | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head1 NAME | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-22 07:04:41 +08:00
										 |  |  | openssl-ts - Time Stamping Authority tool (client/server) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =head1 SYNOPSIS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | B<openssl> B<ts> | 
					
						
							|  |  |  | B<-query> | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-rand> I<file...>] | 
					
						
							|  |  |  | [B<-writerand> I<file>] | 
					
						
							|  |  |  | [B<-config> I<configfile>] | 
					
						
							|  |  |  | [B<-data> I<file_to_hash>] | 
					
						
							|  |  |  | [B<-digest> I<digest_bytes>] | 
					
						
							| 
									
										
										
										
											2019-10-02 23:13:03 +08:00
										 |  |  | [B<-I<digest>>] | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-tspolicy> I<object_id>] | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | [B<-no_nonce>] | 
					
						
							|  |  |  | [B<-cert>] | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-in> I<request.tsq>] | 
					
						
							|  |  |  | [B<-out> I<request.tsq>] | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | [B<-text>] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | B<openssl> B<ts> | 
					
						
							|  |  |  | B<-reply> | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-config> I<configfile>] | 
					
						
							|  |  |  | [B<-section> I<tsa_section>] | 
					
						
							|  |  |  | [B<-queryfile> I<request.tsq>] | 
					
						
							|  |  |  | [B<-passin> I<password_src>] | 
					
						
							|  |  |  | [B<-signer> I<tsa_cert.pem>] | 
					
						
							|  |  |  | [B<-inkey> I<file_or_id>] | 
					
						
							| 
									
										
										
										
											2019-10-02 23:13:03 +08:00
										 |  |  | [B<-I<digest>>] | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-chain> I<certs_file.pem>] | 
					
						
							|  |  |  | [B<-tspolicy> I<object_id>] | 
					
						
							|  |  |  | [B<-in> I<response.tsr>] | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | [B<-token_in>] | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-out> I<response.tsr>] | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | [B<-token_out>] | 
					
						
							|  |  |  | [B<-text>] | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-engine> I<id>] | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | B<openssl> B<ts> | 
					
						
							|  |  |  | B<-verify> | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-data> I<file_to_hash>] | 
					
						
							|  |  |  | [B<-digest> I<digest_bytes>] | 
					
						
							|  |  |  | [B<-queryfile> I<request.tsq>] | 
					
						
							|  |  |  | [B<-in> I<response.tsr>] | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | [B<-token_in>] | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-CApath> I<trusted_cert_path>] | 
					
						
							|  |  |  | [B<-CAfile> I<trusted_certs.pem>] | 
					
						
							|  |  |  | [B<-untrusted> I<cert_file.pem>] | 
					
						
							| 
									
										
										
										
											2016-03-15 17:08:49 +08:00
										 |  |  | [I<verify options>] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | I<verify options:> | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | [B<-attime> I<timestamp>] | 
					
						
							|  |  |  | [B<-check_ss_sig>] | 
					
						
							|  |  |  | [B<-crl_check>] | 
					
						
							|  |  |  | [B<-crl_check_all>] | 
					
						
							|  |  |  | [B<-explicit_policy>] | 
					
						
							|  |  |  | [B<-extended_crl>] | 
					
						
							|  |  |  | [B<-ignore_critical>] | 
					
						
							|  |  |  | [B<-inhibit_any>] | 
					
						
							|  |  |  | [B<-inhibit_map>] | 
					
						
							|  |  |  | [B<-issuer_checks>] | 
					
						
							|  |  |  | [B<-no_alt_chains>] | 
					
						
							|  |  |  | [B<-no_check_time>] | 
					
						
							|  |  |  | [B<-partial_chain>] | 
					
						
							|  |  |  | [B<-policy> I<arg>] | 
					
						
							|  |  |  | [B<-policy_check>] | 
					
						
							|  |  |  | [B<-policy_print>] | 
					
						
							|  |  |  | [B<-purpose> I<purpose>] | 
					
						
							|  |  |  | [B<-suiteB_128>] | 
					
						
							|  |  |  | [B<-suiteB_128_only>] | 
					
						
							|  |  |  | [B<-suiteB_192>] | 
					
						
							|  |  |  | [B<-trusted_first>] | 
					
						
							|  |  |  | [B<-use_deltas>] | 
					
						
							|  |  |  | [B<-auth_level> I<num>] | 
					
						
							|  |  |  | [B<-verify_depth> I<num>] | 
					
						
							|  |  |  | [B<-verify_email> I<email>] | 
					
						
							|  |  |  | [B<-verify_hostname> I<hostname>] | 
					
						
							|  |  |  | [B<-verify_ip> I<ip>] | 
					
						
							|  |  |  | [B<-verify_name> I<name>] | 
					
						
							|  |  |  | [B<-x509_strict>] | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-23 07:49:25 +08:00
										 |  |  | =for comment ifdef engine | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | =head1 DESCRIPTION | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The B<ts> command is a basic Time Stamping Authority (TSA) client and server | 
					
						
							|  |  |  | application as specified in RFC 3161 (Time-Stamp Protocol, TSP). A | 
					
						
							|  |  |  | TSA can be part of a PKI deployment and its role is to provide long | 
					
						
							|  |  |  | term proof of the existence of a certain datum before a particular | 
					
						
							|  |  |  | time. Here is a brief description of the protocol: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =over 4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item 1. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The TSA client computes a one-way hash value for a data file and sends | 
					
						
							|  |  |  | the hash to the TSA. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item 2. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The TSA attaches the current date and time to the received hash value, | 
					
						
							|  |  |  | signs them and sends the time stamp token back to the client. By | 
					
						
							|  |  |  | creating this token the TSA certifies the existence of the original | 
					
						
							|  |  |  | data file at the time of response generation. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item 3. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The TSA client receives the time stamp token and verifies the | 
					
						
							|  |  |  | signature on it. It also checks if the token contains the same hash | 
					
						
							|  |  |  | value that it had sent to the TSA. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =back | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | There is one DER encoded protocol data unit defined for transporting a time | 
					
						
							|  |  |  | stamp request to the TSA and one for sending the time stamp response | 
					
						
							|  |  |  | back to the client. The B<ts> command has three main functions: | 
					
						
							|  |  |  | creating a time stamp request based on a data file, | 
					
						
							|  |  |  | creating a time stamp response based on a request, verifying if a | 
					
						
							|  |  |  | response corresponds to a particular request or a data file. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | There is no support for sending the requests/responses automatically | 
					
						
							|  |  |  | over HTTP or TCP yet as suggested in RFC 3161. The users must send the | 
					
						
							|  |  |  | requests either by ftp or e-mail. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head1 OPTIONS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head2 Time Stamp Request generation | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The B<-query> switch can be used for creating and printing a time stamp | 
					
						
							|  |  |  | request with the following options: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =over 4 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-rand> I<file...> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-05 22:58:48 +08:00
										 |  |  | A file or files containing random data used to seed the random number | 
					
						
							|  |  |  | generator. | 
					
						
							|  |  |  | Multiple files can be specified separated by an OS-dependent character. | 
					
						
							|  |  |  | The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for | 
					
						
							|  |  |  | all others. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-writerand> I<file> | 
					
						
							| 
									
										
										
										
											2017-07-05 22:58:48 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Writes random data to the specified I<file> upon exit. | 
					
						
							|  |  |  | This can be used with a subsequent B<-rand> flag. | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-config> I<configfile> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-08 00:33:21 +08:00
										 |  |  | The configuration file to use. | 
					
						
							|  |  |  | Optional; for a description of the default value, | 
					
						
							|  |  |  | see L<openssl(1)/COMMAND SUMMARY>. | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-data> I<file_to_hash> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The data file for which the time stamp request needs to be | 
					
						
							|  |  |  | created. stdin is the default if neither the B<-data> nor the B<-digest> | 
					
						
							|  |  |  | parameter is specified. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-digest> I<digest_bytes> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | It is possible to specify the message imprint explicitly without the data | 
					
						
							|  |  |  | file. The imprint must be specified in a hexadecimal format, two characters | 
					
						
							|  |  |  | per byte, the bytes optionally separated by colons (e.g. 1A:F6:01:... or | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | 1AF601...). The number of bytes must match the message digest algorithm | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | in use. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-02 23:13:03 +08:00
										 |  |  | =item B<-I<digest>> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-28 00:28:08 +08:00
										 |  |  | The message digest to apply to the data file. | 
					
						
							|  |  |  | Any digest supported by the OpenSSL B<dgst> command can be used. | 
					
						
							| 
									
										
										
										
											2019-06-12 18:01:19 +08:00
										 |  |  | The default is SHA-256. (Optional) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-tspolicy> I<object_id> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The policy that the client expects the TSA to use for creating the | 
					
						
							|  |  |  | time stamp token. Either the dotted OID notation or OID names defined | 
					
						
							|  |  |  | in the config file can be used. If no policy is requested the TSA will | 
					
						
							|  |  |  | use its own default policy. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<-no_nonce> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | No nonce is specified in the request if this option is | 
					
						
							|  |  |  | given. Otherwise a 64 bit long pseudo-random none is | 
					
						
							|  |  |  | included in the request. It is recommended to use nonce to | 
					
						
							|  |  |  | protect against replay-attacks. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<-cert> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The TSA is expected to include its signing certificate in the | 
					
						
							|  |  |  | response. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-in> I<request.tsq> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | This option specifies a previously created time stamp request in DER | 
					
						
							|  |  |  | format that will be printed into the output file. Useful when you need | 
					
						
							|  |  |  | to examine the content of a request in human-readable | 
					
						
							|  |  |  | format. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-out> I<request.tsq> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Name of the output file to which the request will be written. Default | 
					
						
							|  |  |  | is stdout. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<-text> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | If this option is specified the output is human-readable text format | 
					
						
							|  |  |  | instead of DER. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =back | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head2 Time Stamp Response generation | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | A time stamp response (TimeStampResp) consists of a response status | 
					
						
							|  |  |  | and the time stamp token itself (ContentInfo), if the token generation was | 
					
						
							|  |  |  | successful. The B<-reply> command is for creating a time stamp | 
					
						
							|  |  |  | response or time stamp token based on a request and printing the | 
					
						
							|  |  |  | response/token in human-readable format. If B<-token_out> is not | 
					
						
							|  |  |  | specified the output is always a time stamp response (TimeStampResp), | 
					
						
							|  |  |  | otherwise it is a time stamp token (ContentInfo). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =over 4 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-config> I<configfile> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-08 00:33:21 +08:00
										 |  |  | The configuration file to use. | 
					
						
							|  |  |  | Optional; for a description of the default value, | 
					
						
							|  |  |  | see L<openssl(1)/COMMAND SUMMARY>. | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | See L</CONFIGURATION FILE OPTIONS> for configurable variables. | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-section> I<tsa_section> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | The name of the config file section containing the settings for the | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | response generation. If not specified the default TSA section is | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | used, see L</CONFIGURATION FILE OPTIONS> for details. (Optional) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-queryfile> I<request.tsq> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The name of the file containing a DER encoded time stamp request. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-passin> I<password_src> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Specifies the password source for the private key of the TSA. See | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | description in L<openssl(1)>. (Optional) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-signer> I<tsa_cert.pem> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The signer certificate of the TSA in PEM format. The TSA signing | 
					
						
							|  |  |  | certificate must have exactly one extended key usage assigned to it: | 
					
						
							|  |  |  | timeStamping. The extended key usage must also be critical, otherwise | 
					
						
							|  |  |  | the certificate is going to be refused. Overrides the B<signer_cert> | 
					
						
							|  |  |  | variable of the config file. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-inkey> I<file_or_id> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The signer private key of the TSA in PEM format. Overrides the | 
					
						
							|  |  |  | B<signer_key> config file option. (Optional) | 
					
						
							| 
									
										
										
										
											2017-05-21 09:44:31 +08:00
										 |  |  | If no engine is used, the argument is taken as a file; if an engine is | 
					
						
							|  |  |  | specified, the argument is given to the engine as a key identifier. | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-02 23:13:03 +08:00
										 |  |  | =item B<-I<digest>> | 
					
						
							| 
									
										
										
										
											2015-09-11 23:58:57 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Signing digest to use. Overrides the B<signer_digest> config file | 
					
						
							| 
									
										
										
										
											2019-03-06 23:51:49 +08:00
										 |  |  | option. (Mandatory unless specified in the config file) | 
					
						
							| 
									
										
										
										
											2015-09-11 23:58:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-chain> I<certs_file.pem> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The collection of certificates in PEM format that will all | 
					
						
							|  |  |  | be included in the response in addition to the signer certificate if | 
					
						
							|  |  |  | the B<-cert> option was used for the request. This file is supposed to | 
					
						
							|  |  |  | contain the certificate chain for the signer certificate from its | 
					
						
							|  |  |  | issuer upwards. The B<-reply> command does not build a certificate | 
					
						
							|  |  |  | chain automatically. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-tspolicy> I<object_id> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The default policy to use for the response unless the client | 
					
						
							|  |  |  | explicitly requires a particular TSA policy. The OID can be specified | 
					
						
							|  |  |  | either in dotted notation or with its name. Overrides the | 
					
						
							|  |  |  | B<default_policy> config file option. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-in> I<response.tsr> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Specifies a previously created time stamp response or time stamp token | 
					
						
							|  |  |  | (if B<-token_in> is also specified) in DER format that will be written | 
					
						
							|  |  |  | to the output file. This option does not require a request, it is | 
					
						
							|  |  |  | useful e.g. when you need to examine the content of a response or | 
					
						
							|  |  |  | token or you want to extract the time stamp token from a response. If | 
					
						
							|  |  |  | the input is a token and the output is a time stamp response a default | 
					
						
							|  |  |  | 'granted' status info is added to the token. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<-token_in> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This flag can be used together with the B<-in> option and indicates | 
					
						
							|  |  |  | that the input is a DER encoded time stamp token (ContentInfo) instead | 
					
						
							|  |  |  | of a time stamp response (TimeStampResp). (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-out> I<response.tsr> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The response is written to this file. The format and content of the | 
					
						
							|  |  |  | file depends on other options (see B<-text>, B<-token_out>). The default is | 
					
						
							|  |  |  | stdout. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<-token_out> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The output is a time stamp token (ContentInfo) instead of time stamp | 
					
						
							|  |  |  | response (TimeStampResp). (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<-text> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | If this option is specified the output is human-readable text format | 
					
						
							|  |  |  | instead of DER. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-engine> I<id> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-15 23:27:03 +08:00
										 |  |  | Specifying an engine (by its unique B<id> string) will cause B<ts> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | to attempt to obtain a functional reference to the specified engine, | 
					
						
							|  |  |  | thus initialising it if needed. The engine will then be set as the default | 
					
						
							|  |  |  | for all available algorithms. Default is builtin. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =back | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head2 Time Stamp Response verification | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The B<-verify> command is for verifying if a time stamp response or time | 
					
						
							|  |  |  | stamp token is valid and matches a particular time stamp request or | 
					
						
							|  |  |  | data file. The B<-verify> command does not use the configuration file. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =over 4 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-data> I<file_to_hash> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The response or token must be verified against file_to_hash. The file | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | is hashed with the message digest algorithm specified in the token. | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | The B<-digest> and B<-queryfile> options must not be specified with this one. | 
					
						
							|  |  |  | (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-digest> I<digest_bytes> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The response or token must be verified against the message digest specified | 
					
						
							|  |  |  | with this option. The number of bytes must match the message digest algorithm | 
					
						
							|  |  |  | specified in the token. The B<-data> and B<-queryfile> options must not be | 
					
						
							|  |  |  | specified with this one. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-queryfile> I<request.tsq> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The original time stamp request in DER format. The B<-data> and B<-digest> | 
					
						
							|  |  |  | options must not be specified with this one. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-in> I<response.tsr> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The time stamp response that needs to be verified in DER format. (Mandatory) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<-token_in> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This flag can be used together with the B<-in> option and indicates | 
					
						
							|  |  |  | that the input is a DER encoded time stamp token (ContentInfo) instead | 
					
						
							|  |  |  | of a time stamp response (TimeStampResp). (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-CApath> I<trusted_cert_path> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | The name of the directory containing the trusted CA certificates of the | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | client. See the similar option of L<verify(1)> for additional | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | details. Either this option or B<-CAfile> must be specified. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-CAfile> I<trusted_certs.pem> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | The name of the file containing a set of trusted self-signed CA | 
					
						
							|  |  |  | certificates in PEM format. See the similar option of | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | L<verify(1)> for additional details. Either this option | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | or B<-CApath> must be specified. | 
					
						
							|  |  |  | (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | =item B<-untrusted> I<cert_file.pem> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Set of additional untrusted certificates in PEM format which may be | 
					
						
							|  |  |  | needed when building the certificate chain for the TSA's signing | 
					
						
							|  |  |  | certificate. This file must contain the TSA signing certificate and | 
					
						
							|  |  |  | all intermediate CA certificates unless the response includes them. | 
					
						
							|  |  |  | (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-15 17:08:49 +08:00
										 |  |  | =item I<verify options> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 03:20:11 +08:00
										 |  |  | The options B<-attime>, B<-check_ss_sig>, B<-crl_check>, | 
					
						
							| 
									
										
										
										
											2016-03-19 10:09:41 +08:00
										 |  |  | B<-crl_check_all>, B<-explicit_policy>, B<-extended_crl>, B<-ignore_critical>, | 
					
						
							|  |  |  | B<-inhibit_any>, B<-inhibit_map>, B<-issuer_checks>, B<-no_alt_chains>, | 
					
						
							|  |  |  | B<-no_check_time>, B<-partial_chain>, B<-policy>, B<-policy_check>, | 
					
						
							|  |  |  | B<-policy_print>, B<-purpose>, B<-suiteB_128>, B<-suiteB_128_only>, | 
					
						
							|  |  |  | B<-suiteB_192>, B<-trusted_first>, B<-use_deltas>, B<-auth_level>, | 
					
						
							|  |  |  | B<-verify_depth>, B<-verify_email>, B<-verify_hostname>, B<-verify_ip>, | 
					
						
							|  |  |  | B<-verify_name>, and B<-x509_strict> can be used to control timestamp | 
					
						
							|  |  |  | verification.  See L<verify(1)>. | 
					
						
							| 
									
										
										
										
											2016-03-15 17:08:49 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | =back | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head1 CONFIGURATION FILE OPTIONS | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-08 00:33:21 +08:00
										 |  |  | The B<-query> and B<-reply> commands make use of a configuration file. | 
					
						
							|  |  |  | See L<config(5)> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | for a general description of the syntax of the config file. The | 
					
						
							|  |  |  | B<-query> command uses only the symbolic OID names section | 
					
						
							|  |  |  | and it can work without it. However, the B<-reply> command needs the | 
					
						
							|  |  |  | config file for its operation. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | When there is a command line switch equivalent of a variable the | 
					
						
							|  |  |  | switch always overrides the settings in the config file. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =over 4 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | =item B<tsa> section, B<default_tsa> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | This is the main section and it specifies the name of another section | 
					
						
							|  |  |  | that contains all the options for the B<-reply> command. This default | 
					
						
							| 
									
										
										
										
											2013-12-24 02:28:30 +08:00
										 |  |  | section can be overridden with the B<-section> command line switch. (Optional) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =item B<oid_file> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | See L<ca(1)> for description. (Optional) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =item B<oid_section> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | See L<ca(1)> for description. (Optional) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =item B<RANDFILE> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | See L<ca(1)> for description. (Optional) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =item B<serial> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The name of the file containing the hexadecimal serial number of the | 
					
						
							|  |  |  | last time stamp response created. This number is incremented by 1 for | 
					
						
							| 
									
										
										
										
											2007-12-03 17:02:29 +08:00
										 |  |  | each response. If the file does not exist at the time of response | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | generation a new file is created with serial number 1. (Mandatory) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<crypto_device> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | Specifies the OpenSSL engine that will be set as the default for | 
					
						
							|  |  |  | all available algorithms. The default value is builtin, you can specify | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | any other engines supported by OpenSSL (e.g. use chil for the NCipher HSM). | 
					
						
							|  |  |  | (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<signer_cert> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TSA signing certificate in PEM format. The same as the B<-signer> | 
					
						
							|  |  |  | command line option. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<certs> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | A file containing a set of PEM encoded certificates that need to be | 
					
						
							|  |  |  | included in the response. The same as the B<-chain> command line | 
					
						
							|  |  |  | option. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<signer_key> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The private key of the TSA in PEM format. The same as the B<-inkey> | 
					
						
							|  |  |  | command line option. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-11 23:58:57 +08:00
										 |  |  | =item B<signer_digest> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Signing digest to use. The same as the | 
					
						
							| 
									
										
										
										
											2019-10-02 23:13:03 +08:00
										 |  |  | B<-I<digest>> command line option. (Mandatory unless specified on the command | 
					
						
							| 
									
										
										
										
											2019-03-06 23:51:49 +08:00
										 |  |  | line) | 
					
						
							| 
									
										
										
										
											2015-09-11 23:58:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | =item B<default_policy> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The default policy to use when the request does not mandate any | 
					
						
							| 
									
										
										
										
											2016-03-15 17:08:49 +08:00
										 |  |  | policy. The same as the B<-tspolicy> command line option. (Optional) | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =item B<other_policies> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Comma separated list of policies that are also acceptable by the TSA | 
					
						
							|  |  |  | and used only if the request explicitly specifies one of them. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<digests> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The list of message digest algorithms that the TSA accepts. At least | 
					
						
							|  |  |  | one algorithm must be specified. (Mandatory) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<accuracy> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The accuracy of the time source of the TSA in seconds, milliseconds | 
					
						
							|  |  |  | and microseconds. E.g. secs:1, millisecs:500, microsecs:100. If any of | 
					
						
							|  |  |  | the components is missing zero is assumed for that field. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<clock_precision_digits> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | Specifies the maximum number of digits, which represent the fraction of | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | seconds, that  need to be included in the time field. The trailing zeroes | 
					
						
							|  |  |  | must be removed from the time, so there might actually be fewer digits, | 
					
						
							|  |  |  | or no fraction of seconds at all. Supported only on UNIX platforms. | 
					
						
							|  |  |  | The maximum value is 6, default is 0. | 
					
						
							|  |  |  | (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<ordering> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | If this option is yes the responses generated by this TSA can always | 
					
						
							|  |  |  | be ordered, even if the time difference between two responses is less | 
					
						
							|  |  |  | than the sum of their accuracies. Default is no. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<tsa_name> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Set this option to yes if the subject name of the TSA must be included in | 
					
						
							|  |  |  | the TSA name field of the response. Default is no. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item B<ess_cert_id_chain> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The SignedData objects created by the TSA always contain the | 
					
						
							|  |  |  | certificate identifier of the signing certificate in a signed | 
					
						
							|  |  |  | attribute (see RFC 2634, Enhanced Security Services). If this option | 
					
						
							|  |  |  | is set to yes and either the B<certs> variable or the B<-chain> option | 
					
						
							|  |  |  | is specified then the certificate identifiers of the chain will also | 
					
						
							|  |  |  | be included in the SigningCertificate signed attribute. If this | 
					
						
							|  |  |  | variable is set to no, only the signing certificate identifier is | 
					
						
							|  |  |  | included. Default is no. (Optional) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-02 00:32:10 +08:00
										 |  |  | =item B<ess_cert_id_alg> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This option specifies the hash function to be used to calculate the TSA's | 
					
						
							| 
									
										
										
										
											2018-12-14 19:10:58 +08:00
										 |  |  | public key certificate identifier. Default is sha256. (Optional) | 
					
						
							| 
									
										
										
										
											2016-03-02 00:32:10 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | =back | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head1 EXAMPLES | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | All the examples below presume that B<OPENSSL_CONF> is set to a proper | 
					
						
							| 
									
										
										
										
											2015-04-14 00:29:52 +08:00
										 |  |  | configuration file, e.g. the example configuration file | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | openssl/apps/openssl.cnf will do. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head2 Time Stamp Request | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-12 18:01:19 +08:00
										 |  |  | To create a time stamp request for design1.txt with SHA-256 digest, | 
					
						
							|  |  |  | without nonce and policy, and without requirement for a certificate | 
					
						
							|  |  |  | in the response: | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -query -data design1.txt -no_nonce \ | 
					
						
							| 
									
										
										
										
											2016-05-20 20:11:46 +08:00
										 |  |  |         -out design1.tsq | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | To create a similar time stamp request with specifying the message imprint | 
					
						
							|  |  |  | explicitly: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -query -digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \ | 
					
						
							| 
									
										
										
										
											2016-05-20 20:11:46 +08:00
										 |  |  |          -no_nonce -out design1.tsq | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | To print the content of the previous request in human readable format: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -query -in design1.tsq -text | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-14 19:10:58 +08:00
										 |  |  | To create a time stamp request which includes the SHA-512 digest | 
					
						
							| 
									
										
										
										
											2019-06-12 18:01:19 +08:00
										 |  |  | of design2.txt, requests the signer certificate and nonce, and | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | specifies a policy id (assuming the tsa_policy1 name is defined in the | 
					
						
							|  |  |  | OID section of the config file): | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-14 19:10:58 +08:00
										 |  |  |   openssl ts -query -data design2.txt -sha512 \ | 
					
						
							| 
									
										
										
										
											2016-05-20 20:11:46 +08:00
										 |  |  |         -tspolicy tsa_policy1 -cert -out design2.tsq | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | =head2 Time Stamp Response | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Before generating a response a signing certificate must be created for | 
					
						
							|  |  |  | the TSA that contains the B<timeStamping> critical extended key usage extension | 
					
						
							| 
									
										
										
										
											2018-07-04 00:45:14 +08:00
										 |  |  | without any other key usage extensions. You can add this line to the | 
					
						
							|  |  |  | user certificate section of the config file to generate a proper certificate; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    extendedKeyUsage = critical,timeStamping | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | See L<req(1)>, L<ca(1)>, and L<x509(1)> for instructions. The examples | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | below assume that cacert.pem contains the certificate of the CA, | 
					
						
							|  |  |  | tsacert.pem is the signing certificate issued by cacert.pem and | 
					
						
							|  |  |  | tsakey.pem is the private key of the TSA. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | To create a time stamp response for a request: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -reply -queryfile design1.tsq -inkey tsakey.pem \ | 
					
						
							| 
									
										
										
										
											2016-05-20 20:11:46 +08:00
										 |  |  |         -signer tsacert.pem -out design1.tsr | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | If you want to use the settings in the config file you could just write: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -reply -queryfile design1.tsq -out design1.tsr | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | To print a time stamp reply to stdout in human readable format: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -reply -in design1.tsr -text | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | To create a time stamp token instead of time stamp response: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -reply -queryfile design1.tsq -out design1_token.der -token_out | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | To print a time stamp token to stdout in human readable format: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -reply -in design1_token.der -token_in -text -token_out | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | To extract the time stamp token from a response: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -reply -in design1.tsr -out design1_token.der -token_out | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | To add 'granted' status info to a time stamp token thereby creating a | 
					
						
							|  |  |  | valid response: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -reply -in design1_token.der -token_in -out design1.tsr | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head2 Time Stamp Verification | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | To verify a time stamp reply against a request: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -verify -queryfile design1.tsq -in design1.tsr \ | 
					
						
							| 
									
										
										
										
											2016-05-20 20:11:46 +08:00
										 |  |  |         -CAfile cacert.pem -untrusted tsacert.pem | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | To verify a time stamp reply that includes the certificate chain: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   openssl ts -verify -queryfile design2.tsq -in design2.tsr \ | 
					
						
							| 
									
										
										
										
											2016-05-20 20:11:46 +08:00
										 |  |  |         -CAfile cacert.pem | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | To verify a time stamp token against the original data file: | 
					
						
							|  |  |  |   openssl ts -verify -data design2.txt -in design2.tsr \ | 
					
						
							| 
									
										
										
										
											2016-05-20 20:11:46 +08:00
										 |  |  |         -CAfile cacert.pem | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | To verify a time stamp token against a message imprint: | 
					
						
							|  |  |  |   openssl ts -verify -digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \ | 
					
						
							| 
									
										
										
										
											2016-05-20 20:11:46 +08:00
										 |  |  |          -in design2.tsr -CAfile cacert.pem | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | You could also look at the 'test' directory for more examples. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head1 BUGS | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-11 16:33:47 +08:00
										 |  |  | =for comment foreign manuals: procmail(1), perl(1) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-08 01:37:47 +08:00
										 |  |  | =over 2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item * | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-08 01:37:47 +08:00
										 |  |  | No support for time stamps over SMTP, though it is quite easy | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | to implement an automatic e-mail based TSA with L<procmail(1)> | 
					
						
							|  |  |  | and L<perl(1)>. HTTP server support is provided in the form of | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | a separate apache module. HTTP client support is provided by | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | L<tsget(1)>. Pure TCP/IP protocol is not supported. | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-08 01:37:47 +08:00
										 |  |  | =item * | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The file containing the last serial number of the TSA is not | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | locked when being read or written. This is a problem if more than one | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | instance of L<openssl(1)> is trying to create a time stamp | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | response at the same time. This is not an issue when using the apache | 
					
						
							|  |  |  | server module, it does proper locking. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-08 01:37:47 +08:00
										 |  |  | =item * | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Look for the FIXME word in the source files. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =item * | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The source code should really be reviewed by somebody else, too. | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-08 01:37:47 +08:00
										 |  |  | =item * | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-08 01:37:47 +08:00
										 |  |  | More testing is needed, I have done only some basic tests (see | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | test/testtsa). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =back | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =head1 SEE ALSO | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-22 07:04:41 +08:00
										 |  |  | L<openssl(1)>, | 
					
						
							|  |  |  | L<openssl-tsget(1)>, | 
					
						
							|  |  |  | L<openssl-req(1)>, | 
					
						
							|  |  |  | L<openssl-x509(1)>, | 
					
						
							|  |  |  | L<openssl-ca(1)>, | 
					
						
							|  |  |  | L<openssl-genrsa(1)>, | 
					
						
							| 
									
										
										
										
											2015-08-18 03:21:33 +08:00
										 |  |  | L<config(5)> | 
					
						
							| 
									
										
										
										
											2006-02-13 07:11:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 23:44:05 +08:00
										 |  |  | =head1 COPYRIGHT | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-22 07:04:41 +08:00
										 |  |  | Copyright 2006-2019 The OpenSSL Project Authors. All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2016-05-18 23:44:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-06 21:04:11 +08:00
										 |  |  | Licensed under the Apache License 2.0 (the "License").  You may not use | 
					
						
							| 
									
										
										
										
											2016-05-18 23:44:05 +08:00
										 |  |  | this file except in compliance with the License.  You can obtain a copy | 
					
						
							|  |  |  | in the file LICENSE in the source distribution or at | 
					
						
							|  |  |  | L<https://www.openssl.org/source/license.html>. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | =cut |