xref: /freebsd/crypto/openssl/doc/man1/tsget.pod (revision e71b70530d95c4f34d8bdbd78d1242df1ba4a945)
1*e71b7053SJung-uk Kim=pod
2*e71b7053SJung-uk Kim
3*e71b7053SJung-uk Kim=head1 NAME
4*e71b7053SJung-uk Kim
5*e71b7053SJung-uk Kimopenssl-tsget,
6*e71b7053SJung-uk Kimtsget - Time Stamping HTTP/HTTPS client
7*e71b7053SJung-uk Kim
8*e71b7053SJung-uk Kim=head1 SYNOPSIS
9*e71b7053SJung-uk Kim
10*e71b7053SJung-uk KimB<tsget>
11*e71b7053SJung-uk KimB<-h> server_url
12*e71b7053SJung-uk Kim[B<-e> extension]
13*e71b7053SJung-uk Kim[B<-o> output]
14*e71b7053SJung-uk Kim[B<-v>]
15*e71b7053SJung-uk Kim[B<-d>]
16*e71b7053SJung-uk Kim[B<-k> private_key.pem]
17*e71b7053SJung-uk Kim[B<-p> key_password]
18*e71b7053SJung-uk Kim[B<-c> client_cert.pem]
19*e71b7053SJung-uk Kim[B<-C> CA_certs.pem]
20*e71b7053SJung-uk Kim[B<-P> CA_path]
21*e71b7053SJung-uk Kim[B<-r> file:file...]
22*e71b7053SJung-uk Kim[B<-g> EGD_socket]
23*e71b7053SJung-uk Kim[request]...
24*e71b7053SJung-uk Kim
25*e71b7053SJung-uk Kim=head1 DESCRIPTION
26*e71b7053SJung-uk Kim
27*e71b7053SJung-uk KimThe B<tsget> command can be used for sending a time stamp request, as
28*e71b7053SJung-uk Kimspecified in B<RFC 3161>, to a time stamp server over HTTP or HTTPS and storing
29*e71b7053SJung-uk Kimthe time stamp response in a file. This tool cannot be used for creating the
30*e71b7053SJung-uk Kimrequests and verifying responses, you can use the OpenSSL B<ts(1)> command to
31*e71b7053SJung-uk Kimdo that. B<tsget> can send several requests to the server without closing
32*e71b7053SJung-uk Kimthe TCP connection if more than one requests are specified on the command
33*e71b7053SJung-uk Kimline.
34*e71b7053SJung-uk Kim
35*e71b7053SJung-uk KimThe tool sends the following HTTP request for each time stamp request:
36*e71b7053SJung-uk Kim
37*e71b7053SJung-uk Kim        POST url HTTP/1.1
38*e71b7053SJung-uk Kim        User-Agent: OpenTSA tsget.pl/<version>
39*e71b7053SJung-uk Kim        Host: <host>:<port>
40*e71b7053SJung-uk Kim        Pragma: no-cache
41*e71b7053SJung-uk Kim        Content-Type: application/timestamp-query
42*e71b7053SJung-uk Kim        Accept: application/timestamp-reply
43*e71b7053SJung-uk Kim        Content-Length: length of body
44*e71b7053SJung-uk Kim
45*e71b7053SJung-uk Kim        ...binary request specified by the user...
46*e71b7053SJung-uk Kim
47*e71b7053SJung-uk KimB<tsget> expects a response of type application/timestamp-reply, which is
48*e71b7053SJung-uk Kimwritten to a file without any interpretation.
49*e71b7053SJung-uk Kim
50*e71b7053SJung-uk Kim=head1 OPTIONS
51*e71b7053SJung-uk Kim
52*e71b7053SJung-uk Kim=over 4
53*e71b7053SJung-uk Kim
54*e71b7053SJung-uk Kim=item B<-h> server_url
55*e71b7053SJung-uk Kim
56*e71b7053SJung-uk KimThe URL of the HTTP/HTTPS server listening for time stamp requests.
57*e71b7053SJung-uk Kim
58*e71b7053SJung-uk Kim=item B<-e> extension
59*e71b7053SJung-uk Kim
60*e71b7053SJung-uk KimIf the B<-o> option is not given this argument specifies the extension of the
61*e71b7053SJung-uk Kimoutput files. The base name of the output file will be the same as those of
62*e71b7053SJung-uk Kimthe input files. Default extension is '.tsr'. (Optional)
63*e71b7053SJung-uk Kim
64*e71b7053SJung-uk Kim=item B<-o> output
65*e71b7053SJung-uk Kim
66*e71b7053SJung-uk KimThis option can be specified only when just one request is sent to the
67*e71b7053SJung-uk Kimserver. The time stamp response will be written to the given output file. '-'
68*e71b7053SJung-uk Kimmeans standard output. In case of multiple time stamp requests or the absence
69*e71b7053SJung-uk Kimof this argument the names of the output files will be derived from the names
70*e71b7053SJung-uk Kimof the input files and the default or specified extension argument. (Optional)
71*e71b7053SJung-uk Kim
72*e71b7053SJung-uk Kim=item B<-v>
73*e71b7053SJung-uk Kim
74*e71b7053SJung-uk KimThe name of the currently processed request is printed on standard
75*e71b7053SJung-uk Kimerror. (Optional)
76*e71b7053SJung-uk Kim
77*e71b7053SJung-uk Kim=item B<-d>
78*e71b7053SJung-uk Kim
79*e71b7053SJung-uk KimSwitches on verbose mode for the underlying B<curl> library. You can see
80*e71b7053SJung-uk Kimdetailed debug messages for the connection. (Optional)
81*e71b7053SJung-uk Kim
82*e71b7053SJung-uk Kim=item B<-k> private_key.pem
83*e71b7053SJung-uk Kim
84*e71b7053SJung-uk Kim(HTTPS) In case of certificate-based client authentication over HTTPS
85*e71b7053SJung-uk Kim<private_key.pem> must contain the private key of the user. The private key
86*e71b7053SJung-uk Kimfile can optionally be protected by a passphrase. The B<-c> option must also
87*e71b7053SJung-uk Kimbe specified. (Optional)
88*e71b7053SJung-uk Kim
89*e71b7053SJung-uk Kim=item B<-p> key_password
90*e71b7053SJung-uk Kim
91*e71b7053SJung-uk Kim(HTTPS) Specifies the passphrase for the private key specified by the B<-k>
92*e71b7053SJung-uk Kimargument. If this option is omitted and the key is passphrase protected B<tsget>
93*e71b7053SJung-uk Kimwill ask for it. (Optional)
94*e71b7053SJung-uk Kim
95*e71b7053SJung-uk Kim=item B<-c> client_cert.pem
96*e71b7053SJung-uk Kim
97*e71b7053SJung-uk Kim(HTTPS) In case of certificate-based client authentication over HTTPS
98*e71b7053SJung-uk Kim<client_cert.pem> must contain the X.509 certificate of the user.  The B<-k>
99*e71b7053SJung-uk Kimoption must also be specified. If this option is not specified no
100*e71b7053SJung-uk Kimcertificate-based client authentication will take place. (Optional)
101*e71b7053SJung-uk Kim
102*e71b7053SJung-uk Kim=item B<-C> CA_certs.pem
103*e71b7053SJung-uk Kim
104*e71b7053SJung-uk Kim(HTTPS) The trusted CA certificate store. The certificate chain of the peer's
105*e71b7053SJung-uk Kimcertificate must include one of the CA certificates specified in this file.
106*e71b7053SJung-uk KimEither option B<-C> or option B<-P> must be given in case of HTTPS. (Optional)
107*e71b7053SJung-uk Kim
108*e71b7053SJung-uk Kim=item B<-P> CA_path
109*e71b7053SJung-uk Kim
110*e71b7053SJung-uk Kim(HTTPS) The path containing the trusted CA certificates to verify the peer's
111*e71b7053SJung-uk Kimcertificate. The directory must be prepared with the B<c_rehash>
112*e71b7053SJung-uk KimOpenSSL utility. Either option B<-C> or option B<-P> must be given in case of
113*e71b7053SJung-uk KimHTTPS. (Optional)
114*e71b7053SJung-uk Kim
115*e71b7053SJung-uk Kim=item B<-rand> file:file...
116*e71b7053SJung-uk Kim
117*e71b7053SJung-uk KimThe files containing random data for seeding the random number
118*e71b7053SJung-uk Kimgenerator. Multiple files can be specified, the separator is B<;> for
119*e71b7053SJung-uk KimMS-Windows, B<,> for VMS and B<:> for all other platforms. (Optional)
120*e71b7053SJung-uk Kim
121*e71b7053SJung-uk Kim=item B<-g> EGD_socket
122*e71b7053SJung-uk Kim
123*e71b7053SJung-uk KimThe name of an EGD socket to get random data from. (Optional)
124*e71b7053SJung-uk Kim
125*e71b7053SJung-uk Kim=item [request]...
126*e71b7053SJung-uk Kim
127*e71b7053SJung-uk KimList of files containing B<RFC 3161> DER-encoded time stamp requests. If no
128*e71b7053SJung-uk Kimrequests are specified only one request will be sent to the server and it will be
129*e71b7053SJung-uk Kimread from the standard input. (Optional)
130*e71b7053SJung-uk Kim
131*e71b7053SJung-uk Kim=back
132*e71b7053SJung-uk Kim
133*e71b7053SJung-uk Kim=head1 ENVIRONMENT VARIABLES
134*e71b7053SJung-uk Kim
135*e71b7053SJung-uk KimThe B<TSGET> environment variable can optionally contain default
136*e71b7053SJung-uk Kimarguments. The content of this variable is added to the list of command line
137*e71b7053SJung-uk Kimarguments.
138*e71b7053SJung-uk Kim
139*e71b7053SJung-uk Kim=head1 EXAMPLES
140*e71b7053SJung-uk Kim
141*e71b7053SJung-uk KimThe examples below presume that B<file1.tsq> and B<file2.tsq> contain valid
142*e71b7053SJung-uk Kimtime stamp requests, tsa.opentsa.org listens at port 8080 for HTTP requests
143*e71b7053SJung-uk Kimand at port 8443 for HTTPS requests, the TSA service is available at the /tsa
144*e71b7053SJung-uk Kimabsolute path.
145*e71b7053SJung-uk Kim
146*e71b7053SJung-uk KimGet a time stamp response for file1.tsq over HTTP, output is written to
147*e71b7053SJung-uk Kimfile1.tsr:
148*e71b7053SJung-uk Kim
149*e71b7053SJung-uk Kim  tsget -h http://tsa.opentsa.org:8080/tsa file1.tsq
150*e71b7053SJung-uk Kim
151*e71b7053SJung-uk KimGet a time stamp response for file1.tsq and file2.tsq over HTTP showing
152*e71b7053SJung-uk Kimprogress, output is written to file1.reply and file2.reply respectively:
153*e71b7053SJung-uk Kim
154*e71b7053SJung-uk Kim  tsget -h http://tsa.opentsa.org:8080/tsa -v -e .reply \
155*e71b7053SJung-uk Kim        file1.tsq file2.tsq
156*e71b7053SJung-uk Kim
157*e71b7053SJung-uk KimCreate a time stamp request, write it to file3.tsq, send it to the server and
158*e71b7053SJung-uk Kimwrite the response to file3.tsr:
159*e71b7053SJung-uk Kim
160*e71b7053SJung-uk Kim  openssl ts -query -data file3.txt -cert | tee file3.tsq \
161*e71b7053SJung-uk Kim        | tsget -h http://tsa.opentsa.org:8080/tsa \
162*e71b7053SJung-uk Kim        -o file3.tsr
163*e71b7053SJung-uk Kim
164*e71b7053SJung-uk KimGet a time stamp response for file1.tsq over HTTPS without client
165*e71b7053SJung-uk Kimauthentication:
166*e71b7053SJung-uk Kim
167*e71b7053SJung-uk Kim  tsget -h https://tsa.opentsa.org:8443/tsa \
168*e71b7053SJung-uk Kim        -C cacerts.pem file1.tsq
169*e71b7053SJung-uk Kim
170*e71b7053SJung-uk KimGet a time stamp response for file1.tsq over HTTPS with certificate-based
171*e71b7053SJung-uk Kimclient authentication (it will ask for the passphrase if client_key.pem is
172*e71b7053SJung-uk Kimprotected):
173*e71b7053SJung-uk Kim
174*e71b7053SJung-uk Kim  tsget -h https://tsa.opentsa.org:8443/tsa -C cacerts.pem \
175*e71b7053SJung-uk Kim        -k client_key.pem -c client_cert.pem file1.tsq
176*e71b7053SJung-uk Kim
177*e71b7053SJung-uk KimYou can shorten the previous command line if you make use of the B<TSGET>
178*e71b7053SJung-uk Kimenvironment variable. The following commands do the same as the previous
179*e71b7053SJung-uk Kimexample:
180*e71b7053SJung-uk Kim
181*e71b7053SJung-uk Kim  TSGET='-h https://tsa.opentsa.org:8443/tsa -C cacerts.pem \
182*e71b7053SJung-uk Kim        -k client_key.pem -c client_cert.pem'
183*e71b7053SJung-uk Kim  export TSGET
184*e71b7053SJung-uk Kim  tsget file1.tsq
185*e71b7053SJung-uk Kim
186*e71b7053SJung-uk Kim=head1 SEE ALSO
187*e71b7053SJung-uk Kim
188*e71b7053SJung-uk Kim=for comment foreign manuals: curl(1)
189*e71b7053SJung-uk Kim
190*e71b7053SJung-uk KimL<openssl(1)>, L<ts(1)>, L<curl(1)>,
191*e71b7053SJung-uk KimB<RFC 3161>
192*e71b7053SJung-uk Kim
193*e71b7053SJung-uk Kim=head1 COPYRIGHT
194*e71b7053SJung-uk Kim
195*e71b7053SJung-uk KimCopyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
196*e71b7053SJung-uk Kim
197*e71b7053SJung-uk KimLicensed under the OpenSSL license (the "License").  You may not use
198*e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
199*e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
200*e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
201*e71b7053SJung-uk Kim
202*e71b7053SJung-uk Kim=cut
203