2
0

tsget.pod 5.9 KB

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