1b077aed3SPierre Pronchery=pod 2b077aed3SPierre Pronchery{- OpenSSL::safe::output_do_not_edit_headers(); -} 3b077aed3SPierre Pronchery 4b077aed3SPierre Pronchery=head1 NAME 5b077aed3SPierre Pronchery 6b077aed3SPierre Proncheryopenssl-ts - Time Stamping Authority command 7b077aed3SPierre Pronchery 8b077aed3SPierre Pronchery=head1 SYNOPSIS 9b077aed3SPierre Pronchery 10b077aed3SPierre ProncheryB<openssl> B<ts> 11b077aed3SPierre ProncheryB<-help> 12b077aed3SPierre Pronchery 13b077aed3SPierre ProncheryB<openssl> B<ts> 14b077aed3SPierre ProncheryB<-query> 15b077aed3SPierre Pronchery[B<-config> I<configfile>] 16b077aed3SPierre Pronchery[B<-data> I<file_to_hash>] 17b077aed3SPierre Pronchery[B<-digest> I<digest_bytes>] 18b077aed3SPierre Pronchery[B<-I<digest>>] 19b077aed3SPierre Pronchery[B<-tspolicy> I<object_id>] 20b077aed3SPierre Pronchery[B<-no_nonce>] 21b077aed3SPierre Pronchery[B<-cert>] 22b077aed3SPierre Pronchery[B<-in> I<request.tsq>] 23b077aed3SPierre Pronchery[B<-out> I<request.tsq>] 24b077aed3SPierre Pronchery[B<-text>] 25b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_r_synopsis -} 26b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_provider_synopsis -} 27b077aed3SPierre Pronchery 28b077aed3SPierre ProncheryB<openssl> B<ts> 29b077aed3SPierre ProncheryB<-reply> 30b077aed3SPierre Pronchery[B<-config> I<configfile>] 31b077aed3SPierre Pronchery[B<-section> I<tsa_section>] 32b077aed3SPierre Pronchery[B<-queryfile> I<request.tsq>] 33b077aed3SPierre Pronchery[B<-passin> I<password_src>] 34b077aed3SPierre Pronchery[B<-signer> I<tsa_cert.pem>] 35b077aed3SPierre Pronchery[B<-inkey> I<filename>|I<uri>] 36b077aed3SPierre Pronchery[B<-I<digest>>] 37b077aed3SPierre Pronchery[B<-chain> I<certs_file.pem>] 38b077aed3SPierre Pronchery[B<-tspolicy> I<object_id>] 39b077aed3SPierre Pronchery[B<-in> I<response.tsr>] 40b077aed3SPierre Pronchery[B<-token_in>] 41b077aed3SPierre Pronchery[B<-out> I<response.tsr>] 42b077aed3SPierre Pronchery[B<-token_out>] 43b077aed3SPierre Pronchery[B<-text>] 44b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_provider_synopsis -} 45b077aed3SPierre Pronchery 46b077aed3SPierre ProncheryB<openssl> B<ts> 47b077aed3SPierre ProncheryB<-verify> 48b077aed3SPierre Pronchery[B<-data> I<file_to_hash>] 49b077aed3SPierre Pronchery[B<-digest> I<digest_bytes>] 50b077aed3SPierre Pronchery[B<-queryfile> I<request.tsq>] 51b077aed3SPierre Pronchery[B<-in> I<response.tsr>] 52b077aed3SPierre Pronchery[B<-token_in>] 53b077aed3SPierre Pronchery[B<-untrusted> I<files>|I<uris>] 54b077aed3SPierre Pronchery[B<-CAfile> I<file>] 55b077aed3SPierre Pronchery[B<-CApath> I<dir>] 56b077aed3SPierre Pronchery[B<-CAstore> I<uri>] 57b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_v_synopsis -} 58b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_provider_synopsis -} 59b077aed3SPierre Pronchery 60b077aed3SPierre Pronchery=head1 DESCRIPTION 61b077aed3SPierre Pronchery 62b077aed3SPierre ProncheryThis command is a basic Time Stamping Authority (TSA) client and 63b077aed3SPierre Proncheryserver application as specified in RFC 3161 (Time-Stamp Protocol, TSP). A 64b077aed3SPierre ProncheryTSA can be part of a PKI deployment and its role is to provide long 65b077aed3SPierre Proncheryterm proof of the existence of a certain datum before a particular 66b077aed3SPierre Proncherytime. Here is a brief description of the protocol: 67b077aed3SPierre Pronchery 68b077aed3SPierre Pronchery=over 4 69b077aed3SPierre Pronchery 70b077aed3SPierre Pronchery=item 1. 71b077aed3SPierre Pronchery 72b077aed3SPierre ProncheryThe TSA client computes a one-way hash value for a data file and sends 73b077aed3SPierre Proncherythe hash to the TSA. 74b077aed3SPierre Pronchery 75b077aed3SPierre Pronchery=item 2. 76b077aed3SPierre Pronchery 77b077aed3SPierre ProncheryThe TSA attaches the current date and time to the received hash value, 78b077aed3SPierre Proncherysigns them and sends the timestamp token back to the client. By 79b077aed3SPierre Proncherycreating this token the TSA certifies the existence of the original 80b077aed3SPierre Proncherydata file at the time of response generation. 81b077aed3SPierre Pronchery 82b077aed3SPierre Pronchery=item 3. 83b077aed3SPierre Pronchery 84b077aed3SPierre ProncheryThe TSA client receives the timestamp token and verifies the 85b077aed3SPierre Proncherysignature on it. It also checks if the token contains the same hash 86b077aed3SPierre Proncheryvalue that it had sent to the TSA. 87b077aed3SPierre Pronchery 88b077aed3SPierre Pronchery=back 89b077aed3SPierre Pronchery 90b077aed3SPierre ProncheryThere is one DER encoded protocol data unit defined for transporting a 91b077aed3SPierre Proncherytimestamp request to the TSA and one for sending the timestamp response 92b077aed3SPierre Proncheryback to the client. This command has three main functions: 93b077aed3SPierre Proncherycreating a timestamp request based on a data file, 94b077aed3SPierre Proncherycreating a timestamp response based on a request, verifying if a 95b077aed3SPierre Proncheryresponse corresponds to a particular request or a data file. 96b077aed3SPierre Pronchery 97b077aed3SPierre ProncheryThere is no support for sending the requests/responses automatically 98b077aed3SPierre Proncheryover HTTP or TCP yet as suggested in RFC 3161. The users must send the 99b077aed3SPierre Proncheryrequests either by ftp or e-mail. 100b077aed3SPierre Pronchery 101b077aed3SPierre Pronchery=head1 OPTIONS 102b077aed3SPierre Pronchery 103b077aed3SPierre Pronchery=over 4 104b077aed3SPierre Pronchery 105b077aed3SPierre Pronchery=item B<-help> 106b077aed3SPierre Pronchery 107b077aed3SPierre ProncheryPrint out a usage message. 108b077aed3SPierre Pronchery 109b077aed3SPierre Pronchery=item B<-query> 110b077aed3SPierre Pronchery 111b077aed3SPierre ProncheryGenerate a TS query. For details see L</Timestamp Request generation>. 112b077aed3SPierre Pronchery 113b077aed3SPierre Pronchery=item B<-reply> 114b077aed3SPierre Pronchery 115b077aed3SPierre ProncheryGenerate a TS reply. For details see L</Timestamp Response generation>. 116b077aed3SPierre Pronchery 117b077aed3SPierre Pronchery=item B<-verify> 118b077aed3SPierre Pronchery 119b077aed3SPierre ProncheryVerify a TS response. For details see L</Timestamp Response verification>. 120b077aed3SPierre Pronchery 121b077aed3SPierre Pronchery=back 122b077aed3SPierre Pronchery 123b077aed3SPierre Pronchery=head2 Timestamp Request generation 124b077aed3SPierre Pronchery 125b077aed3SPierre ProncheryThe B<-query> command can be used for creating and printing a timestamp 126b077aed3SPierre Proncheryrequest with the following options: 127b077aed3SPierre Pronchery 128b077aed3SPierre Pronchery=over 4 129b077aed3SPierre Pronchery 130b077aed3SPierre Pronchery=item B<-config> I<configfile> 131b077aed3SPierre Pronchery 132b077aed3SPierre ProncheryThe configuration file to use. 133b077aed3SPierre ProncheryOptional; for a description of the default value, 134b077aed3SPierre Proncherysee L<openssl(1)/COMMAND SUMMARY>. 135b077aed3SPierre Pronchery 136b077aed3SPierre Pronchery=item B<-data> I<file_to_hash> 137b077aed3SPierre Pronchery 138b077aed3SPierre ProncheryThe data file for which the timestamp request needs to be 139b077aed3SPierre Proncherycreated. stdin is the default if neither the B<-data> nor the B<-digest> 140b077aed3SPierre Proncheryparameter is specified. (Optional) 141b077aed3SPierre Pronchery 142b077aed3SPierre Pronchery=item B<-digest> I<digest_bytes> 143b077aed3SPierre Pronchery 144b077aed3SPierre ProncheryIt is possible to specify the message imprint explicitly without the data 145b077aed3SPierre Proncheryfile. The imprint must be specified in a hexadecimal format, two characters 146b077aed3SPierre Proncheryper byte, the bytes optionally separated by colons (e.g. 1A:F6:01:... or 147b077aed3SPierre Pronchery1AF601...). The number of bytes must match the message digest algorithm 148b077aed3SPierre Proncheryin use. (Optional) 149b077aed3SPierre Pronchery 150b077aed3SPierre Pronchery=item B<-I<digest>> 151b077aed3SPierre Pronchery 152b077aed3SPierre ProncheryThe message digest to apply to the data file. 153b077aed3SPierre ProncheryAny digest supported by the L<openssl-dgst(1)> command can be used. 154b077aed3SPierre ProncheryThe default is SHA-256. (Optional) 155b077aed3SPierre Pronchery 156b077aed3SPierre Pronchery=item B<-tspolicy> I<object_id> 157b077aed3SPierre Pronchery 158b077aed3SPierre ProncheryThe policy that the client expects the TSA to use for creating the 159b077aed3SPierre Proncherytimestamp token. Either the dotted OID notation or OID names defined 160b077aed3SPierre Proncheryin the config file can be used. If no policy is requested the TSA will 161b077aed3SPierre Proncheryuse its own default policy. (Optional) 162b077aed3SPierre Pronchery 163b077aed3SPierre Pronchery=item B<-no_nonce> 164b077aed3SPierre Pronchery 165b077aed3SPierre ProncheryNo nonce is specified in the request if this option is 166*44096ebdSEnji Coopergiven. Otherwise, a 64-bit long pseudo-random nonce is 167*44096ebdSEnji Cooperincluded in the request. It is recommended to use a nonce to 168*44096ebdSEnji Cooperprotect against replay attacks. (Optional) 169b077aed3SPierre Pronchery 170b077aed3SPierre Pronchery=item B<-cert> 171b077aed3SPierre Pronchery 172b077aed3SPierre ProncheryThe TSA is expected to include its signing certificate in the 173b077aed3SPierre Proncheryresponse. (Optional) 174b077aed3SPierre Pronchery 175b077aed3SPierre Pronchery=item B<-in> I<request.tsq> 176b077aed3SPierre Pronchery 177b077aed3SPierre ProncheryThis option specifies a previously created timestamp request in DER 178b077aed3SPierre Proncheryformat that will be printed into the output file. Useful when you need 179b077aed3SPierre Proncheryto examine the content of a request in human-readable 180b077aed3SPierre Proncheryformat. (Optional) 181b077aed3SPierre Pronchery 182b077aed3SPierre Pronchery=item B<-out> I<request.tsq> 183b077aed3SPierre Pronchery 184b077aed3SPierre ProncheryName of the output file to which the request will be written. Default 185b077aed3SPierre Proncheryis stdout. (Optional) 186b077aed3SPierre Pronchery 187b077aed3SPierre Pronchery=item B<-text> 188b077aed3SPierre Pronchery 189b077aed3SPierre ProncheryIf this option is specified the output is human-readable text format 190b077aed3SPierre Proncheryinstead of DER. (Optional) 191b077aed3SPierre Pronchery 192b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_r_item -} 193b077aed3SPierre Pronchery 194b077aed3SPierre Pronchery=back 195b077aed3SPierre Pronchery 196b077aed3SPierre Pronchery=head2 Timestamp Response generation 197b077aed3SPierre Pronchery 198b077aed3SPierre ProncheryA timestamp response (TimeStampResp) consists of a response status 199b077aed3SPierre Proncheryand the timestamp token itself (ContentInfo), if the token generation was 200b077aed3SPierre Proncherysuccessful. The B<-reply> command is for creating a timestamp 201b077aed3SPierre Proncheryresponse or timestamp token based on a request and printing the 202b077aed3SPierre Proncheryresponse/token in human-readable format. If B<-token_out> is not 203b077aed3SPierre Proncheryspecified the output is always a timestamp response (TimeStampResp), 204b077aed3SPierre Proncheryotherwise it is a timestamp token (ContentInfo). 205b077aed3SPierre Pronchery 206b077aed3SPierre Pronchery=over 4 207b077aed3SPierre Pronchery 208b077aed3SPierre Pronchery=item B<-config> I<configfile> 209b077aed3SPierre Pronchery 210b077aed3SPierre ProncheryThe configuration file to use. 211b077aed3SPierre ProncheryOptional; for a description of the default value, 212b077aed3SPierre Proncherysee L<openssl(1)/COMMAND SUMMARY>. 213b077aed3SPierre ProncherySee L</CONFIGURATION FILE OPTIONS> for configurable variables. 214b077aed3SPierre Pronchery 215b077aed3SPierre Pronchery=item B<-section> I<tsa_section> 216b077aed3SPierre Pronchery 217b077aed3SPierre ProncheryThe name of the config file section containing the settings for the 218b077aed3SPierre Proncheryresponse generation. If not specified the default TSA section is 219b077aed3SPierre Proncheryused, see L</CONFIGURATION FILE OPTIONS> for details. (Optional) 220b077aed3SPierre Pronchery 221b077aed3SPierre Pronchery=item B<-queryfile> I<request.tsq> 222b077aed3SPierre Pronchery 223b077aed3SPierre ProncheryThe name of the file containing a DER encoded timestamp request. (Optional) 224b077aed3SPierre Pronchery 225b077aed3SPierre Pronchery=item B<-passin> I<password_src> 226b077aed3SPierre Pronchery 227b077aed3SPierre ProncherySpecifies the password source for the private key of the TSA. See 228b077aed3SPierre Proncherydescription in L<openssl(1)>. (Optional) 229b077aed3SPierre Pronchery 230b077aed3SPierre Pronchery=item B<-signer> I<tsa_cert.pem> 231b077aed3SPierre Pronchery 232b077aed3SPierre ProncheryThe signer certificate of the TSA in PEM format. The TSA signing 233b077aed3SPierre Proncherycertificate must have exactly one extended key usage assigned to it: 234b077aed3SPierre ProncherytimeStamping. The extended key usage must also be critical, otherwise 235b077aed3SPierre Proncherythe certificate is going to be refused. Overrides the B<signer_cert> 236b077aed3SPierre Proncheryvariable of the config file. (Optional) 237b077aed3SPierre Pronchery 238b077aed3SPierre Pronchery=item B<-inkey> I<filename>|I<uri> 239b077aed3SPierre Pronchery 240b077aed3SPierre ProncheryThe signer private key of the TSA in PEM format. Overrides the 241b077aed3SPierre ProncheryB<signer_key> config file option. (Optional) 242b077aed3SPierre Pronchery 243b077aed3SPierre Pronchery=item B<-I<digest>> 244b077aed3SPierre Pronchery 245b077aed3SPierre ProncherySigning digest to use. Overrides the B<signer_digest> config file 246b077aed3SPierre Proncheryoption. (Mandatory unless specified in the config file) 247b077aed3SPierre Pronchery 248b077aed3SPierre Pronchery=item B<-chain> I<certs_file.pem> 249b077aed3SPierre Pronchery 250b077aed3SPierre ProncheryThe collection of certificates in PEM format that will all 251b077aed3SPierre Proncherybe included in the response in addition to the signer certificate if 252b077aed3SPierre Proncherythe B<-cert> option was used for the request. This file is supposed to 253b077aed3SPierre Proncherycontain the certificate chain for the signer certificate from its 254b077aed3SPierre Proncheryissuer upwards. The B<-reply> command does not build a certificate 255b077aed3SPierre Proncherychain automatically. (Optional) 256b077aed3SPierre Pronchery 257b077aed3SPierre Pronchery=item B<-tspolicy> I<object_id> 258b077aed3SPierre Pronchery 259b077aed3SPierre ProncheryThe default policy to use for the response unless the client 260b077aed3SPierre Proncheryexplicitly requires a particular TSA policy. The OID can be specified 261b077aed3SPierre Proncheryeither in dotted notation or with its name. Overrides the 262b077aed3SPierre ProncheryB<default_policy> config file option. (Optional) 263b077aed3SPierre Pronchery 264b077aed3SPierre Pronchery=item B<-in> I<response.tsr> 265b077aed3SPierre Pronchery 266b077aed3SPierre ProncherySpecifies a previously created timestamp response or timestamp token 267b077aed3SPierre Pronchery(if B<-token_in> is also specified) in DER format that will be written 268b077aed3SPierre Proncheryto the output file. This option does not require a request, it is 269b077aed3SPierre Proncheryuseful e.g. when you need to examine the content of a response or 270b077aed3SPierre Proncherytoken or you want to extract the timestamp token from a response. If 271b077aed3SPierre Proncherythe input is a token and the output is a timestamp response a default 272b077aed3SPierre Pronchery'granted' status info is added to the token. (Optional) 273b077aed3SPierre Pronchery 274b077aed3SPierre Pronchery=item B<-token_in> 275b077aed3SPierre Pronchery 276b077aed3SPierre ProncheryThis flag can be used together with the B<-in> option and indicates 277b077aed3SPierre Proncherythat the input is a DER encoded timestamp token (ContentInfo) instead 278b077aed3SPierre Proncheryof a timestamp response (TimeStampResp). (Optional) 279b077aed3SPierre Pronchery 280b077aed3SPierre Pronchery=item B<-out> I<response.tsr> 281b077aed3SPierre Pronchery 282b077aed3SPierre ProncheryThe response is written to this file. The format and content of the 283b077aed3SPierre Proncheryfile depends on other options (see B<-text>, B<-token_out>). The default is 284b077aed3SPierre Proncherystdout. (Optional) 285b077aed3SPierre Pronchery 286b077aed3SPierre Pronchery=item B<-token_out> 287b077aed3SPierre Pronchery 288b077aed3SPierre ProncheryThe output is a timestamp token (ContentInfo) instead of timestamp 289b077aed3SPierre Proncheryresponse (TimeStampResp). (Optional) 290b077aed3SPierre Pronchery 291b077aed3SPierre Pronchery=item B<-text> 292b077aed3SPierre Pronchery 293b077aed3SPierre ProncheryIf this option is specified the output is human-readable text format 294b077aed3SPierre Proncheryinstead of DER. (Optional) 295b077aed3SPierre Pronchery 296b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_engine_item -} 297b077aed3SPierre Pronchery 298b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_provider_item -} 299b077aed3SPierre Pronchery 300b077aed3SPierre Pronchery=back 301b077aed3SPierre Pronchery 302b077aed3SPierre Pronchery=head2 Timestamp Response verification 303b077aed3SPierre Pronchery 304b077aed3SPierre ProncheryThe B<-verify> command is for verifying if a timestamp response or 305b077aed3SPierre Proncherytimestamp token is valid and matches a particular timestamp request or 306b077aed3SPierre Proncherydata file. The B<-verify> command does not use the configuration file. 307b077aed3SPierre Pronchery 308b077aed3SPierre Pronchery=over 4 309b077aed3SPierre Pronchery 310b077aed3SPierre Pronchery=item B<-data> I<file_to_hash> 311b077aed3SPierre Pronchery 312b077aed3SPierre ProncheryThe response or token must be verified against file_to_hash. The file 313b077aed3SPierre Proncheryis hashed with the message digest algorithm specified in the token. 314b077aed3SPierre ProncheryThe B<-digest> and B<-queryfile> options must not be specified with this one. 315b077aed3SPierre Pronchery(Optional) 316b077aed3SPierre Pronchery 317b077aed3SPierre Pronchery=item B<-digest> I<digest_bytes> 318b077aed3SPierre Pronchery 319b077aed3SPierre ProncheryThe response or token must be verified against the message digest specified 320b077aed3SPierre Proncherywith this option. The number of bytes must match the message digest algorithm 321b077aed3SPierre Proncheryspecified in the token. The B<-data> and B<-queryfile> options must not be 322b077aed3SPierre Proncheryspecified with this one. (Optional) 323b077aed3SPierre Pronchery 324b077aed3SPierre Pronchery=item B<-queryfile> I<request.tsq> 325b077aed3SPierre Pronchery 326b077aed3SPierre ProncheryThe original timestamp request in DER format. The B<-data> and B<-digest> 327b077aed3SPierre Proncheryoptions must not be specified with this one. (Optional) 328b077aed3SPierre Pronchery 329b077aed3SPierre Pronchery=item B<-in> I<response.tsr> 330b077aed3SPierre Pronchery 331b077aed3SPierre ProncheryThe timestamp response that needs to be verified in DER format. (Mandatory) 332b077aed3SPierre Pronchery 333b077aed3SPierre Pronchery=item B<-token_in> 334b077aed3SPierre Pronchery 335b077aed3SPierre ProncheryThis flag can be used together with the B<-in> option and indicates 336b077aed3SPierre Proncherythat the input is a DER encoded timestamp token (ContentInfo) instead 337b077aed3SPierre Proncheryof a timestamp response (TimeStampResp). (Optional) 338b077aed3SPierre Pronchery 339b077aed3SPierre Pronchery=item B<-untrusted> I<files>|I<uris> 340b077aed3SPierre Pronchery 341b077aed3SPierre ProncheryA set of additional untrusted certificates which may be 342b077aed3SPierre Proncheryneeded when building the certificate chain for the TSA's signing certificate. 343b077aed3SPierre ProncheryThese do not need to contain the TSA signing certificate and intermediate CA 344b077aed3SPierre Proncherycertificates as far as the response already includes them. 345b077aed3SPierre Pronchery(Optional) 346b077aed3SPierre Pronchery 347b077aed3SPierre ProncheryMultiple sources may be given, separated by commas and/or whitespace. 348b077aed3SPierre ProncheryEach file may contain multiple certificates. 349b077aed3SPierre Pronchery 350b077aed3SPierre Pronchery=item B<-CAfile> I<file>, B<-CApath> I<dir>, B<-CAstore> I<uri> 351b077aed3SPierre Pronchery 352b077aed3SPierre ProncherySee L<openssl-verification-options(1)/Trusted Certificate Options> for details. 353b077aed3SPierre ProncheryAt least one of B<-CAfile>, B<-CApath> or B<-CAstore> must be specified. 354b077aed3SPierre Pronchery 355b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_v_item -} 356b077aed3SPierre Pronchery 357b077aed3SPierre ProncheryAny verification errors cause the command to exit. 358b077aed3SPierre Pronchery 359b077aed3SPierre Pronchery=back 360b077aed3SPierre Pronchery 361b077aed3SPierre Pronchery=head1 CONFIGURATION FILE OPTIONS 362b077aed3SPierre Pronchery 363b077aed3SPierre ProncheryThe B<-query> and B<-reply> commands make use of a configuration file. 364b077aed3SPierre ProncherySee L<config(5)> 365b077aed3SPierre Proncheryfor a general description of the syntax of the config file. The 366b077aed3SPierre ProncheryB<-query> command uses only the symbolic OID names section 367b077aed3SPierre Proncheryand it can work without it. However, the B<-reply> command needs the 368b077aed3SPierre Proncheryconfig file for its operation. 369b077aed3SPierre Pronchery 370b077aed3SPierre ProncheryWhen there is a command line switch equivalent of a variable the 371b077aed3SPierre Proncheryswitch always overrides the settings in the config file. 372b077aed3SPierre Pronchery 373b077aed3SPierre Pronchery=over 4 374b077aed3SPierre Pronchery 375b077aed3SPierre Pronchery=item B<tsa> section, B<default_tsa> 376b077aed3SPierre Pronchery 377b077aed3SPierre ProncheryThis is the main section and it specifies the name of another section 378b077aed3SPierre Proncherythat contains all the options for the B<-reply> command. This default 379b077aed3SPierre Proncherysection can be overridden with the B<-section> command line switch. (Optional) 380b077aed3SPierre Pronchery 381b077aed3SPierre Pronchery=item B<oid_file> 382b077aed3SPierre Pronchery 383b077aed3SPierre ProncheryThis specifies a file containing additional B<OBJECT IDENTIFIERS>. 384b077aed3SPierre ProncheryEach line of the file should consist of the numerical form of the 385b077aed3SPierre Proncheryobject identifier followed by whitespace then the short name followed 386b077aed3SPierre Proncheryby whitespace and finally the long name. (Optional) 387b077aed3SPierre Pronchery 388b077aed3SPierre Pronchery=item B<oid_section> 389b077aed3SPierre Pronchery 390b077aed3SPierre ProncheryThis specifies a section in the configuration file containing extra 391b077aed3SPierre Proncheryobject identifiers. Each line should consist of the short name of the 392b077aed3SPierre Proncheryobject identifier followed by B<=> and the numerical form. The short 393b077aed3SPierre Proncheryand long names are the same when this option is used. (Optional) 394b077aed3SPierre Pronchery 395b077aed3SPierre Pronchery=item B<RANDFILE> 396b077aed3SPierre Pronchery 397b077aed3SPierre ProncheryAt startup the specified file is loaded into the random number generator, 398b077aed3SPierre Proncheryand at exit 256 bytes will be written to it. (Note: Using a RANDFILE is 399b077aed3SPierre Proncherynot necessary anymore, see the L</HISTORY> section. 400b077aed3SPierre Pronchery 401b077aed3SPierre Pronchery=item B<serial> 402b077aed3SPierre Pronchery 403b077aed3SPierre ProncheryThe name of the file containing the hexadecimal serial number of the 404b077aed3SPierre Proncherylast timestamp response created. This number is incremented by 1 for 405b077aed3SPierre Proncheryeach response. If the file does not exist at the time of response 406b077aed3SPierre Proncherygeneration a new file is created with serial number 1. (Mandatory) 407b077aed3SPierre Pronchery 408b077aed3SPierre Pronchery=item B<crypto_device> 409b077aed3SPierre Pronchery 410b077aed3SPierre ProncherySpecifies the OpenSSL engine that will be set as the default for 411b077aed3SPierre Proncheryall available algorithms. The default value is built-in, you can specify 412b077aed3SPierre Proncheryany other engines supported by OpenSSL (e.g. use chil for the NCipher HSM). 413b077aed3SPierre Pronchery(Optional) 414b077aed3SPierre Pronchery 415b077aed3SPierre Pronchery=item B<signer_cert> 416b077aed3SPierre Pronchery 417b077aed3SPierre ProncheryTSA signing certificate in PEM format. The same as the B<-signer> 418b077aed3SPierre Proncherycommand line option. (Optional) 419b077aed3SPierre Pronchery 420b077aed3SPierre Pronchery=item B<certs> 421b077aed3SPierre Pronchery 422b077aed3SPierre ProncheryA file containing a set of PEM encoded certificates that need to be 423b077aed3SPierre Proncheryincluded in the response. The same as the B<-chain> command line 424b077aed3SPierre Proncheryoption. (Optional) 425b077aed3SPierre Pronchery 426b077aed3SPierre Pronchery=item B<signer_key> 427b077aed3SPierre Pronchery 428b077aed3SPierre ProncheryThe private key of the TSA in PEM format. The same as the B<-inkey> 429b077aed3SPierre Proncherycommand line option. (Optional) 430b077aed3SPierre Pronchery 431b077aed3SPierre Pronchery=item B<signer_digest> 432b077aed3SPierre Pronchery 433b077aed3SPierre ProncherySigning digest to use. The same as the 434b077aed3SPierre ProncheryB<-I<digest>> command line option. (Mandatory unless specified on the command 435b077aed3SPierre Proncheryline) 436b077aed3SPierre Pronchery 437b077aed3SPierre Pronchery=item B<default_policy> 438b077aed3SPierre Pronchery 439b077aed3SPierre ProncheryThe default policy to use when the request does not mandate any 440b077aed3SPierre Proncherypolicy. The same as the B<-tspolicy> command line option. (Optional) 441b077aed3SPierre Pronchery 442b077aed3SPierre Pronchery=item B<other_policies> 443b077aed3SPierre Pronchery 444b077aed3SPierre ProncheryComma separated list of policies that are also acceptable by the TSA 445b077aed3SPierre Proncheryand used only if the request explicitly specifies one of them. (Optional) 446b077aed3SPierre Pronchery 447b077aed3SPierre Pronchery=item B<digests> 448b077aed3SPierre Pronchery 449b077aed3SPierre ProncheryThe list of message digest algorithms that the TSA accepts. At least 450b077aed3SPierre Proncheryone algorithm must be specified. (Mandatory) 451b077aed3SPierre Pronchery 452b077aed3SPierre Pronchery=item B<accuracy> 453b077aed3SPierre Pronchery 454b077aed3SPierre ProncheryThe accuracy of the time source of the TSA in seconds, milliseconds 455b077aed3SPierre Proncheryand microseconds. E.g. secs:1, millisecs:500, microsecs:100. If any of 456b077aed3SPierre Proncherythe components is missing zero is assumed for that field. (Optional) 457b077aed3SPierre Pronchery 458b077aed3SPierre Pronchery=item B<clock_precision_digits> 459b077aed3SPierre Pronchery 460b077aed3SPierre ProncherySpecifies the maximum number of digits, which represent the fraction of 461b077aed3SPierre Proncheryseconds, that need to be included in the time field. The trailing zeros 462b077aed3SPierre Proncherymust be removed from the time, so there might actually be fewer digits, 463b077aed3SPierre Proncheryor no fraction of seconds at all. Supported only on UNIX platforms. 464b077aed3SPierre ProncheryThe maximum value is 6, default is 0. 465b077aed3SPierre Pronchery(Optional) 466b077aed3SPierre Pronchery 467b077aed3SPierre Pronchery=item B<ordering> 468b077aed3SPierre Pronchery 469b077aed3SPierre ProncheryIf this option is yes the responses generated by this TSA can always 470b077aed3SPierre Proncherybe ordered, even if the time difference between two responses is less 471b077aed3SPierre Proncherythan the sum of their accuracies. Default is no. (Optional) 472b077aed3SPierre Pronchery 473b077aed3SPierre Pronchery=item B<tsa_name> 474b077aed3SPierre Pronchery 475b077aed3SPierre ProncherySet this option to yes if the subject name of the TSA must be included in 476b077aed3SPierre Proncherythe TSA name field of the response. Default is no. (Optional) 477b077aed3SPierre Pronchery 478b077aed3SPierre Pronchery=item B<ess_cert_id_chain> 479b077aed3SPierre Pronchery 480b077aed3SPierre ProncheryThe SignedData objects created by the TSA always contain the 481b077aed3SPierre Proncherycertificate identifier of the signing certificate in a signed 482b077aed3SPierre Proncheryattribute (see RFC 2634, Enhanced Security Services). 483b077aed3SPierre ProncheryIf this variable is set to no, only this signing certificate identifier 484b077aed3SPierre Proncheryis included in the SigningCertificate signed attribute. 485b077aed3SPierre ProncheryIf this variable is set to yes and the B<certs> variable or the B<-chain> option 486b077aed3SPierre Proncheryis specified then the certificate identifiers of the chain will also 487b077aed3SPierre Proncherybe included, where the B<-chain> option overrides the B<certs> variable. 488b077aed3SPierre ProncheryDefault is no. (Optional) 489b077aed3SPierre Pronchery 490b077aed3SPierre Pronchery=item B<ess_cert_id_alg> 491b077aed3SPierre Pronchery 492b077aed3SPierre ProncheryThis option specifies the hash function to be used to calculate the TSA's 4936f1af0d7SPierre Proncherypublic key certificate identifier. Default is sha1. (Optional) 494b077aed3SPierre Pronchery 495b077aed3SPierre Pronchery=back 496b077aed3SPierre Pronchery 497b077aed3SPierre Pronchery=head1 EXAMPLES 498b077aed3SPierre Pronchery 499b077aed3SPierre ProncheryAll the examples below presume that B<OPENSSL_CONF> is set to a proper 500b077aed3SPierre Proncheryconfiguration file, e.g. the example configuration file 501b077aed3SPierre ProncheryF<openssl/apps/openssl.cnf> will do. 502b077aed3SPierre Pronchery 503b077aed3SPierre Pronchery=head2 Timestamp Request 504b077aed3SPierre Pronchery 505b077aed3SPierre ProncheryTo create a timestamp request for F<design1.txt> with SHA-256 digest, 506b077aed3SPierre Proncherywithout nonce and policy, and without requirement for a certificate 507b077aed3SPierre Proncheryin the response: 508b077aed3SPierre Pronchery 509b077aed3SPierre Pronchery openssl ts -query -data design1.txt -no_nonce \ 510b077aed3SPierre Pronchery -out design1.tsq 511b077aed3SPierre Pronchery 512b077aed3SPierre ProncheryTo create a similar timestamp request with specifying the message imprint 513b077aed3SPierre Proncheryexplicitly: 514b077aed3SPierre Pronchery 515b077aed3SPierre Pronchery openssl ts -query -digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \ 516b077aed3SPierre Pronchery -no_nonce -out design1.tsq 517b077aed3SPierre Pronchery 518b077aed3SPierre ProncheryTo print the content of the previous request in human readable format: 519b077aed3SPierre Pronchery 520b077aed3SPierre Pronchery openssl ts -query -in design1.tsq -text 521b077aed3SPierre Pronchery 522b077aed3SPierre ProncheryTo create a timestamp request which includes the SHA-512 digest 523b077aed3SPierre Proncheryof F<design2.txt>, requests the signer certificate and nonce, and 524b077aed3SPierre Proncheryspecifies a policy id (assuming the tsa_policy1 name is defined in the 525b077aed3SPierre ProncheryOID section of the config file): 526b077aed3SPierre Pronchery 527b077aed3SPierre Pronchery openssl ts -query -data design2.txt -sha512 \ 528b077aed3SPierre Pronchery -tspolicy tsa_policy1 -cert -out design2.tsq 529b077aed3SPierre Pronchery 530b077aed3SPierre Pronchery=head2 Timestamp Response 531b077aed3SPierre Pronchery 532b077aed3SPierre ProncheryBefore generating a response a signing certificate must be created for 533b077aed3SPierre Proncherythe TSA that contains the B<timeStamping> critical extended key usage extension 534b077aed3SPierre Proncherywithout any other key usage extensions. You can add this line to the 535b077aed3SPierre Proncheryuser certificate section of the config file to generate a proper certificate; 536b077aed3SPierre Pronchery 537b077aed3SPierre Pronchery extendedKeyUsage = critical,timeStamping 538b077aed3SPierre Pronchery 539b077aed3SPierre ProncherySee L<openssl-req(1)>, L<openssl-ca(1)>, and L<openssl-x509(1)> for 540b077aed3SPierre Proncheryinstructions. The examples below assume that F<cacert.pem> contains the 541b077aed3SPierre Proncherycertificate of the CA, F<tsacert.pem> is the signing certificate issued 542b077aed3SPierre Proncheryby F<cacert.pem> and F<tsakey.pem> is the private key of the TSA. 543b077aed3SPierre Pronchery 544b077aed3SPierre ProncheryTo create a timestamp response for a request: 545b077aed3SPierre Pronchery 546b077aed3SPierre Pronchery openssl ts -reply -queryfile design1.tsq -inkey tsakey.pem \ 547b077aed3SPierre Pronchery -signer tsacert.pem -out design1.tsr 548b077aed3SPierre Pronchery 549b077aed3SPierre ProncheryIf you want to use the settings in the config file you could just write: 550b077aed3SPierre Pronchery 551b077aed3SPierre Pronchery openssl ts -reply -queryfile design1.tsq -out design1.tsr 552b077aed3SPierre Pronchery 553b077aed3SPierre ProncheryTo print a timestamp reply to stdout in human readable format: 554b077aed3SPierre Pronchery 555b077aed3SPierre Pronchery openssl ts -reply -in design1.tsr -text 556b077aed3SPierre Pronchery 557b077aed3SPierre ProncheryTo create a timestamp token instead of timestamp response: 558b077aed3SPierre Pronchery 559b077aed3SPierre Pronchery openssl ts -reply -queryfile design1.tsq -out design1_token.der -token_out 560b077aed3SPierre Pronchery 561b077aed3SPierre ProncheryTo print a timestamp token to stdout in human readable format: 562b077aed3SPierre Pronchery 563b077aed3SPierre Pronchery openssl ts -reply -in design1_token.der -token_in -text -token_out 564b077aed3SPierre Pronchery 565b077aed3SPierre ProncheryTo extract the timestamp token from a response: 566b077aed3SPierre Pronchery 567b077aed3SPierre Pronchery openssl ts -reply -in design1.tsr -out design1_token.der -token_out 568b077aed3SPierre Pronchery 569b077aed3SPierre ProncheryTo add 'granted' status info to a timestamp token thereby creating a 570b077aed3SPierre Proncheryvalid response: 571b077aed3SPierre Pronchery 572b077aed3SPierre Pronchery openssl ts -reply -in design1_token.der -token_in -out design1.tsr 573b077aed3SPierre Pronchery 574b077aed3SPierre Pronchery=head2 Timestamp Verification 575b077aed3SPierre Pronchery 576b077aed3SPierre ProncheryTo verify a timestamp reply against a request: 577b077aed3SPierre Pronchery 578b077aed3SPierre Pronchery openssl ts -verify -queryfile design1.tsq -in design1.tsr \ 579b077aed3SPierre Pronchery -CAfile cacert.pem -untrusted tsacert.pem 580b077aed3SPierre Pronchery 581b077aed3SPierre ProncheryTo verify a timestamp reply that includes the certificate chain: 582b077aed3SPierre Pronchery 583b077aed3SPierre Pronchery openssl ts -verify -queryfile design2.tsq -in design2.tsr \ 584b077aed3SPierre Pronchery -CAfile cacert.pem 585b077aed3SPierre Pronchery 586b077aed3SPierre ProncheryTo verify a timestamp token against the original data file: 587b077aed3SPierre Pronchery openssl ts -verify -data design2.txt -in design2.tsr \ 588b077aed3SPierre Pronchery -CAfile cacert.pem 589b077aed3SPierre Pronchery 590b077aed3SPierre ProncheryTo verify a timestamp token against a message imprint: 591b077aed3SPierre Pronchery openssl ts -verify -digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \ 592b077aed3SPierre Pronchery -in design2.tsr -CAfile cacert.pem 593b077aed3SPierre Pronchery 594b077aed3SPierre ProncheryYou could also look at the 'test' directory for more examples. 595b077aed3SPierre Pronchery 596b077aed3SPierre Pronchery=head1 BUGS 597b077aed3SPierre Pronchery 598b077aed3SPierre Pronchery=for openssl foreign manual procmail(1) perl(1) 599b077aed3SPierre Pronchery 600b077aed3SPierre Pronchery=over 2 601b077aed3SPierre Pronchery 602b077aed3SPierre Pronchery=item * 603b077aed3SPierre Pronchery 604b077aed3SPierre ProncheryNo support for timestamps over SMTP, though it is quite easy 605b077aed3SPierre Proncheryto implement an automatic e-mail based TSA with L<procmail(1)> 606b077aed3SPierre Proncheryand L<perl(1)>. HTTP server support is provided in the form of 607b077aed3SPierre Proncherya separate apache module. HTTP client support is provided by 608b077aed3SPierre ProncheryL<tsget(1)>. Pure TCP/IP protocol is not supported. 609b077aed3SPierre Pronchery 610b077aed3SPierre Pronchery=item * 611b077aed3SPierre Pronchery 612b077aed3SPierre ProncheryThe file containing the last serial number of the TSA is not 613b077aed3SPierre Proncherylocked when being read or written. This is a problem if more than one 614b077aed3SPierre Proncheryinstance of L<openssl(1)> is trying to create a timestamp 615b077aed3SPierre Proncheryresponse at the same time. This is not an issue when using the apache 616b077aed3SPierre Proncheryserver module, it does proper locking. 617b077aed3SPierre Pronchery 618b077aed3SPierre Pronchery=item * 619b077aed3SPierre Pronchery 620b077aed3SPierre ProncheryLook for the FIXME word in the source files. 621b077aed3SPierre Pronchery 622b077aed3SPierre Pronchery=item * 623b077aed3SPierre Pronchery 624b077aed3SPierre ProncheryThe source code should really be reviewed by somebody else, too. 625b077aed3SPierre Pronchery 626b077aed3SPierre Pronchery=item * 627b077aed3SPierre Pronchery 628b077aed3SPierre ProncheryMore testing is needed, I have done only some basic tests (see 629b077aed3SPierre Proncherytest/testtsa). 630b077aed3SPierre Pronchery 631b077aed3SPierre Pronchery=back 632b077aed3SPierre Pronchery 633b077aed3SPierre Pronchery=head1 HISTORY 634b077aed3SPierre Pronchery 635b077aed3SPierre ProncheryOpenSSL 1.1.1 introduced a new random generator (CSPRNG) with an improved 636b077aed3SPierre Proncheryseeding mechanism. The new seeding mechanism makes it unnecessary to 637b077aed3SPierre Proncherydefine a RANDFILE for saving and restoring randomness. This option is 638b077aed3SPierre Proncheryretained mainly for compatibility reasons. 639b077aed3SPierre Pronchery 640b077aed3SPierre ProncheryThe B<-engine> option was deprecated in OpenSSL 3.0. 641b077aed3SPierre Pronchery 642b077aed3SPierre Pronchery=head1 SEE ALSO 643b077aed3SPierre Pronchery 644b077aed3SPierre ProncheryL<openssl(1)>, 645b077aed3SPierre ProncheryL<tsget(1)>, 646b077aed3SPierre ProncheryL<openssl-req(1)>, 647b077aed3SPierre ProncheryL<openssl-x509(1)>, 648b077aed3SPierre ProncheryL<openssl-ca(1)>, 649b077aed3SPierre ProncheryL<openssl-genrsa(1)>, 650b077aed3SPierre ProncheryL<config(5)>, 651b077aed3SPierre ProncheryL<ossl_store-file(7)> 652b077aed3SPierre Pronchery 653b077aed3SPierre Pronchery=head1 COPYRIGHT 654b077aed3SPierre Pronchery 655*44096ebdSEnji CooperCopyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved. 656b077aed3SPierre Pronchery 657b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 658b077aed3SPierre Proncherythis file except in compliance with the License. You can obtain a copy 659b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at 660b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>. 661b077aed3SPierre Pronchery 662b077aed3SPierre Pronchery=cut 663