tsget.pod 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. =pod
  2. =head1 NAME
  3. openssl-tsget,
  4. tsget - Time Stamping HTTP/HTTPS client
  5. =head1 SYNOPSIS
  6. B<tsget>
  7. B<-h> server_url
  8. [B<-e> extension]
  9. [B<-o> output]
  10. [B<-v>]
  11. [B<-d>]
  12. [B<-k> private_key.pem]
  13. [B<-p> key_password]
  14. [B<-c> client_cert.pem]
  15. [B<-C> CA_certs.pem]
  16. [B<-P> CA_path]
  17. [B<-r> file:file...]
  18. [B<-g> EGD_socket]
  19. [request]...
  20. =head1 DESCRIPTION
  21. The B<tsget> command can be used for sending a time stamp request, as
  22. specified in B<RFC 3161>, to a time stamp server over HTTP or HTTPS and storing
  23. the time stamp response in a file. This tool cannot be used for creating the
  24. requests and verifying responses, you can use the OpenSSL B<ts(1)> command to
  25. do that. B<tsget> can send several requests to the server without closing
  26. the TCP connection if more than one requests are specified on the command
  27. line.
  28. The tool sends the following HTTP request for each time stamp request:
  29. POST url HTTP/1.1
  30. User-Agent: OpenTSA tsget.pl/<version>
  31. Host: <host>:<port>
  32. Pragma: no-cache
  33. Content-Type: application/timestamp-query
  34. Accept: application/timestamp-reply
  35. Content-Length: length of body
  36. ...binary request specified by the user...
  37. B<tsget> expects a response of type application/timestamp-reply, which is
  38. written to a file without any interpretation.
  39. =head1 OPTIONS
  40. =over 4
  41. =item B<-h> server_url
  42. The URL of the HTTP/HTTPS server listening for time stamp requests.
  43. =item B<-e> extension
  44. If the B<-o> option is not given this argument specifies the extension of the
  45. output files. The base name of the output file will be the same as those of
  46. the input files. Default extension is '.tsr'. (Optional)
  47. =item B<-o> output
  48. This option can be specified only when just one request is sent to the
  49. server. The time stamp response will be written to the given output file. '-'
  50. means standard output. In case of multiple time stamp requests or the absence
  51. of this argument the names of the output files will be derived from the names
  52. of the input files and the default or specified extension argument. (Optional)
  53. =item B<-v>
  54. The name of the currently processed request is printed on standard
  55. error. (Optional)
  56. =item B<-d>
  57. Switches on verbose mode for the underlying B<curl> library. You can see
  58. detailed debug messages for the connection. (Optional)
  59. =item B<-k> private_key.pem
  60. (HTTPS) In case of certificate-based client authentication over HTTPS
  61. <private_key.pem> must contain the private key of the user. The private key
  62. file can optionally be protected by a passphrase. The B<-c> option must also
  63. be specified. (Optional)
  64. =item B<-p> key_password
  65. (HTTPS) Specifies the passphrase for the private key specified by the B<-k>
  66. argument. If this option is omitted and the key is passphrase protected B<tsget>
  67. will ask for it. (Optional)
  68. =item B<-c> client_cert.pem
  69. (HTTPS) In case of certificate-based client authentication over HTTPS
  70. <client_cert.pem> must contain the X.509 certificate of the user. The B<-k>
  71. option must also be specified. If this option is not specified no
  72. certificate-based client authentication will take place. (Optional)
  73. =item B<-C> CA_certs.pem
  74. (HTTPS) The trusted CA certificate store. The certificate chain of the peer's
  75. certificate must include one of the CA certificates specified in this file.
  76. Either option B<-C> or option B<-P> must be given in case of HTTPS. (Optional)
  77. =item B<-P> CA_path
  78. (HTTPS) The path containing the trusted CA certificates to verify the peer's
  79. certificate. The directory must be prepared with the B<c_rehash>
  80. OpenSSL utility. Either option B<-C> or option B<-P> must be given in case of
  81. HTTPS. (Optional)
  82. =item B<-rand> file:file...
  83. The files containing random data for seeding the random number
  84. generator. Multiple files can be specified, the separator is B<;> for
  85. MS-Windows, B<,> for VMS and B<:> for all other platforms. (Optional)
  86. =item B<-g> EGD_socket
  87. The name of an EGD socket to get random data from. (Optional)
  88. =item [request]...
  89. List of files containing B<RFC 3161> DER-encoded time stamp requests. If no
  90. requests are specified only one request will be sent to the server and it will be
  91. read from the standard input. (Optional)
  92. =back
  93. =head1 ENVIRONMENT VARIABLES
  94. The B<TSGET> environment variable can optionally contain default
  95. arguments. The content of this variable is added to the list of command line
  96. arguments.
  97. =head1 EXAMPLES
  98. The examples below presume that B<file1.tsq> and B<file2.tsq> contain valid
  99. time stamp requests, tsa.opentsa.org listens at port 8080 for HTTP requests
  100. and at port 8443 for HTTPS requests, the TSA service is available at the /tsa
  101. absolute path.
  102. Get a time stamp response for file1.tsq over HTTP, output is written to
  103. file1.tsr:
  104. tsget -h http://tsa.opentsa.org:8080/tsa file1.tsq
  105. Get a time stamp response for file1.tsq and file2.tsq over HTTP showing
  106. progress, output is written to file1.reply and file2.reply respectively:
  107. tsget -h http://tsa.opentsa.org:8080/tsa -v -e .reply \
  108. file1.tsq file2.tsq
  109. Create a time stamp request, write it to file3.tsq, send it to the server and
  110. write the response to file3.tsr:
  111. openssl ts -query -data file3.txt -cert | tee file3.tsq \
  112. | tsget -h http://tsa.opentsa.org:8080/tsa \
  113. -o file3.tsr
  114. Get a time stamp response for file1.tsq over HTTPS without client
  115. authentication:
  116. tsget -h https://tsa.opentsa.org:8443/tsa \
  117. -C cacerts.pem file1.tsq
  118. Get a time stamp response for file1.tsq over HTTPS with certificate-based
  119. client authentication (it will ask for the passphrase if client_key.pem is
  120. protected):
  121. tsget -h https://tsa.opentsa.org:8443/tsa -C cacerts.pem \
  122. -k client_key.pem -c client_cert.pem file1.tsq
  123. You can shorten the previous command line if you make use of the B<TSGET>
  124. environment variable. The following commands do the same as the previous
  125. example:
  126. TSGET='-h https://tsa.opentsa.org:8443/tsa -C cacerts.pem \
  127. -k client_key.pem -c client_cert.pem'
  128. export TSGET
  129. tsget file1.tsq
  130. =head1 SEE ALSO
  131. =for comment foreign manuals: curl(1)
  132. L<openssl(1)>, L<ts(1)>, L<curl(1)>,
  133. B<RFC 3161>
  134. =head1 COPYRIGHT
  135. Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
  136. Licensed under the OpenSSL license (the "License"). You may not use
  137. this file except in compliance with the License. You can obtain a copy
  138. in the file LICENSE in the source distribution or at
  139. L<https://www.openssl.org/source/license.html>.
  140. =cut