xref: /minix3/crypto/external/bsd/openssl/dist/doc/apps/ts.pod (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc=pod
2ebfedea0SLionel Sambuc
3ebfedea0SLionel Sambuc=head1 NAME
4ebfedea0SLionel Sambuc
5ebfedea0SLionel Sambucts - Time Stamping Authority tool (client/server)
6ebfedea0SLionel Sambuc
7ebfedea0SLionel Sambuc=head1 SYNOPSIS
8ebfedea0SLionel Sambuc
9ebfedea0SLionel SambucB<openssl> B<ts>
10ebfedea0SLionel SambucB<-query>
11ebfedea0SLionel Sambuc[B<-rand> file:file...]
12ebfedea0SLionel Sambuc[B<-config> configfile]
13ebfedea0SLionel Sambuc[B<-data> file_to_hash]
14ebfedea0SLionel Sambuc[B<-digest> digest_bytes]
15ebfedea0SLionel Sambuc[B<-md2>|B<-md4>|B<-md5>|B<-sha>|B<-sha1>|B<-mdc2>|B<-ripemd160>|B<...>]
16ebfedea0SLionel Sambuc[B<-policy> object_id]
17ebfedea0SLionel Sambuc[B<-no_nonce>]
18ebfedea0SLionel Sambuc[B<-cert>]
19ebfedea0SLionel Sambuc[B<-in> request.tsq]
20ebfedea0SLionel Sambuc[B<-out> request.tsq]
21ebfedea0SLionel Sambuc[B<-text>]
22ebfedea0SLionel Sambuc
23ebfedea0SLionel SambucB<openssl> B<ts>
24ebfedea0SLionel SambucB<-reply>
25ebfedea0SLionel Sambuc[B<-config> configfile]
26ebfedea0SLionel Sambuc[B<-section> tsa_section]
27ebfedea0SLionel Sambuc[B<-queryfile> request.tsq]
28ebfedea0SLionel Sambuc[B<-passin> password_src]
29ebfedea0SLionel Sambuc[B<-signer> tsa_cert.pem]
30ebfedea0SLionel Sambuc[B<-inkey> private.pem]
31ebfedea0SLionel Sambuc[B<-chain> certs_file.pem]
32ebfedea0SLionel Sambuc[B<-policy> object_id]
33ebfedea0SLionel Sambuc[B<-in> response.tsr]
34ebfedea0SLionel Sambuc[B<-token_in>]
35ebfedea0SLionel Sambuc[B<-out> response.tsr]
36ebfedea0SLionel Sambuc[B<-token_out>]
37ebfedea0SLionel Sambuc[B<-text>]
38ebfedea0SLionel Sambuc[B<-engine> id]
39ebfedea0SLionel Sambuc
40ebfedea0SLionel SambucB<openssl> B<ts>
41ebfedea0SLionel SambucB<-verify>
42ebfedea0SLionel Sambuc[B<-data> file_to_hash]
43ebfedea0SLionel Sambuc[B<-digest> digest_bytes]
44ebfedea0SLionel Sambuc[B<-queryfile> request.tsq]
45ebfedea0SLionel Sambuc[B<-in> response.tsr]
46ebfedea0SLionel Sambuc[B<-token_in>]
47ebfedea0SLionel Sambuc[B<-CApath> trusted_cert_path]
48ebfedea0SLionel Sambuc[B<-CAfile> trusted_certs.pem]
49ebfedea0SLionel Sambuc[B<-untrusted> cert_file.pem]
50ebfedea0SLionel Sambuc
51ebfedea0SLionel Sambuc=head1 DESCRIPTION
52ebfedea0SLionel Sambuc
53ebfedea0SLionel SambucThe B<ts> command is a basic Time Stamping Authority (TSA) client and server
54ebfedea0SLionel Sambucapplication as specified in RFC 3161 (Time-Stamp Protocol, TSP). A
55ebfedea0SLionel SambucTSA can be part of a PKI deployment and its role is to provide long
56ebfedea0SLionel Sambucterm proof of the existence of a certain datum before a particular
57ebfedea0SLionel Sambuctime. Here is a brief description of the protocol:
58ebfedea0SLionel Sambuc
59ebfedea0SLionel Sambuc=over 4
60ebfedea0SLionel Sambuc
61ebfedea0SLionel Sambuc=item 1.
62ebfedea0SLionel Sambuc
63ebfedea0SLionel SambucThe TSA client computes a one-way hash value for a data file and sends
64ebfedea0SLionel Sambucthe hash to the TSA.
65ebfedea0SLionel Sambuc
66ebfedea0SLionel Sambuc=item 2.
67ebfedea0SLionel Sambuc
68ebfedea0SLionel SambucThe TSA attaches the current date and time to the received hash value,
69ebfedea0SLionel Sambucsigns them and sends the time stamp token back to the client. By
70ebfedea0SLionel Sambuccreating this token the TSA certifies the existence of the original
71ebfedea0SLionel Sambucdata file at the time of response generation.
72ebfedea0SLionel Sambuc
73ebfedea0SLionel Sambuc=item 3.
74ebfedea0SLionel Sambuc
75ebfedea0SLionel SambucThe TSA client receives the time stamp token and verifies the
76ebfedea0SLionel Sambucsignature on it. It also checks if the token contains the same hash
77ebfedea0SLionel Sambucvalue that it had sent to the TSA.
78ebfedea0SLionel Sambuc
79ebfedea0SLionel Sambuc=back
80ebfedea0SLionel Sambuc
81ebfedea0SLionel SambucThere is one DER encoded protocol data unit defined for transporting a time
82ebfedea0SLionel Sambucstamp request to the TSA and one for sending the time stamp response
83ebfedea0SLionel Sambucback to the client. The B<ts> command has three main functions:
84ebfedea0SLionel Sambuccreating a time stamp request based on a data file,
85ebfedea0SLionel Sambuccreating a time stamp response based on a request, verifying if a
86ebfedea0SLionel Sambucresponse corresponds to a particular request or a data file.
87ebfedea0SLionel Sambuc
88ebfedea0SLionel SambucThere is no support for sending the requests/responses automatically
89ebfedea0SLionel Sambucover HTTP or TCP yet as suggested in RFC 3161. The users must send the
90ebfedea0SLionel Sambucrequests either by ftp or e-mail.
91ebfedea0SLionel Sambuc
92ebfedea0SLionel Sambuc=head1 OPTIONS
93ebfedea0SLionel Sambuc
94ebfedea0SLionel Sambuc=head2 Time Stamp Request generation
95ebfedea0SLionel Sambuc
96ebfedea0SLionel SambucThe B<-query> switch can be used for creating and printing a time stamp
97ebfedea0SLionel Sambucrequest with the following options:
98ebfedea0SLionel Sambuc
99ebfedea0SLionel Sambuc=over 4
100ebfedea0SLionel Sambuc
101ebfedea0SLionel Sambuc=item B<-rand> file:file...
102ebfedea0SLionel Sambuc
103ebfedea0SLionel SambucThe files containing random data for seeding the random number
104ebfedea0SLionel Sambucgenerator. Multiple files can be specified, the separator is B<;> for
105ebfedea0SLionel SambucMS-Windows, B<,> for VMS and B<:> for all other platforms. (Optional)
106ebfedea0SLionel Sambuc
107ebfedea0SLionel Sambuc=item B<-config> configfile
108ebfedea0SLionel Sambuc
109ebfedea0SLionel SambucThe configuration file to use, this option overrides the
110ebfedea0SLionel SambucB<OPENSSL_CONF> environment variable. Only the OID section
111ebfedea0SLionel Sambucof the config file is used with the B<-query> command. (Optional)
112ebfedea0SLionel Sambuc
113ebfedea0SLionel Sambuc=item B<-data> file_to_hash
114ebfedea0SLionel Sambuc
115ebfedea0SLionel SambucThe data file for which the time stamp request needs to be
116ebfedea0SLionel Sambuccreated. stdin is the default if neither the B<-data> nor the B<-digest>
117ebfedea0SLionel Sambucparameter is specified. (Optional)
118ebfedea0SLionel Sambuc
119ebfedea0SLionel Sambuc=item B<-digest> digest_bytes
120ebfedea0SLionel Sambuc
121ebfedea0SLionel SambucIt is possible to specify the message imprint explicitly without the data
122ebfedea0SLionel Sambucfile. The imprint must be specified in a hexadecimal format, two characters
123ebfedea0SLionel Sambucper byte, the bytes optionally separated by colons (e.g. 1A:F6:01:... or
124ebfedea0SLionel Sambuc1AF601...). The number of bytes must match the message digest algorithm
125ebfedea0SLionel Sambucin use. (Optional)
126ebfedea0SLionel Sambuc
127ebfedea0SLionel Sambuc=item B<-md2>|B<-md4>|B<-md5>|B<-sha>|B<-sha1>|B<-mdc2>|B<-ripemd160>|B<...>
128ebfedea0SLionel Sambuc
129ebfedea0SLionel SambucThe message digest to apply to the data file, it supports all the message
130ebfedea0SLionel Sambucdigest algorithms that are supported by the openssl B<dgst> command.
131ebfedea0SLionel SambucThe default is SHA-1. (Optional)
132ebfedea0SLionel Sambuc
133ebfedea0SLionel Sambuc=item B<-policy> object_id
134ebfedea0SLionel Sambuc
135ebfedea0SLionel SambucThe policy that the client expects the TSA to use for creating the
136ebfedea0SLionel Sambuctime stamp token. Either the dotted OID notation or OID names defined
137ebfedea0SLionel Sambucin the config file can be used. If no policy is requested the TSA will
138ebfedea0SLionel Sambucuse its own default policy. (Optional)
139ebfedea0SLionel Sambuc
140ebfedea0SLionel Sambuc=item B<-no_nonce>
141ebfedea0SLionel Sambuc
142ebfedea0SLionel SambucNo nonce is specified in the request if this option is
143ebfedea0SLionel Sambucgiven. Otherwise a 64 bit long pseudo-random none is
144ebfedea0SLionel Sambucincluded in the request. It is recommended to use nonce to
145ebfedea0SLionel Sambucprotect against replay-attacks. (Optional)
146ebfedea0SLionel Sambuc
147ebfedea0SLionel Sambuc=item B<-cert>
148ebfedea0SLionel Sambuc
149ebfedea0SLionel SambucThe TSA is expected to include its signing certificate in the
150ebfedea0SLionel Sambucresponse. (Optional)
151ebfedea0SLionel Sambuc
152ebfedea0SLionel Sambuc=item B<-in> request.tsq
153ebfedea0SLionel Sambuc
154ebfedea0SLionel SambucThis option specifies a previously created time stamp request in DER
155ebfedea0SLionel Sambucformat that will be printed into the output file. Useful when you need
156ebfedea0SLionel Sambucto examine the content of a request in human-readable
157ebfedea0SLionel Sambuc
158ebfedea0SLionel Sambucformat. (Optional)
159ebfedea0SLionel Sambuc
160ebfedea0SLionel Sambuc=item B<-out> request.tsq
161ebfedea0SLionel Sambuc
162ebfedea0SLionel SambucName of the output file to which the request will be written. Default
163ebfedea0SLionel Sambucis stdout. (Optional)
164ebfedea0SLionel Sambuc
165ebfedea0SLionel Sambuc=item B<-text>
166ebfedea0SLionel Sambuc
167ebfedea0SLionel SambucIf this option is specified the output is human-readable text format
168ebfedea0SLionel Sambucinstead of DER. (Optional)
169ebfedea0SLionel Sambuc
170ebfedea0SLionel Sambuc=back
171ebfedea0SLionel Sambuc
172ebfedea0SLionel Sambuc=head2 Time Stamp Response generation
173ebfedea0SLionel Sambuc
174ebfedea0SLionel SambucA time stamp response (TimeStampResp) consists of a response status
175ebfedea0SLionel Sambucand the time stamp token itself (ContentInfo), if the token generation was
176ebfedea0SLionel Sambucsuccessful. The B<-reply> command is for creating a time stamp
177ebfedea0SLionel Sambucresponse or time stamp token based on a request and printing the
178ebfedea0SLionel Sambucresponse/token in human-readable format. If B<-token_out> is not
179ebfedea0SLionel Sambucspecified the output is always a time stamp response (TimeStampResp),
180ebfedea0SLionel Sambucotherwise it is a time stamp token (ContentInfo).
181ebfedea0SLionel Sambuc
182ebfedea0SLionel Sambuc=over 4
183ebfedea0SLionel Sambuc
184ebfedea0SLionel Sambuc=item B<-config> configfile
185ebfedea0SLionel Sambuc
186ebfedea0SLionel SambucThe configuration file to use, this option overrides the
187ebfedea0SLionel SambucB<OPENSSL_CONF> environment variable. See B<CONFIGURATION FILE
188ebfedea0SLionel SambucOPTIONS> for configurable variables. (Optional)
189ebfedea0SLionel Sambuc
190ebfedea0SLionel Sambuc=item B<-section> tsa_section
191ebfedea0SLionel Sambuc
192ebfedea0SLionel SambucThe name of the config file section conatining the settings for the
193ebfedea0SLionel Sambucresponse generation. If not specified the default TSA section is
194ebfedea0SLionel Sambucused, see B<CONFIGURATION FILE OPTIONS> for details. (Optional)
195ebfedea0SLionel Sambuc
196ebfedea0SLionel Sambuc=item B<-queryfile> request.tsq
197ebfedea0SLionel Sambuc
198ebfedea0SLionel SambucThe name of the file containing a DER encoded time stamp request. (Optional)
199ebfedea0SLionel Sambuc
200ebfedea0SLionel Sambuc=item B<-passin> password_src
201ebfedea0SLionel Sambuc
202ebfedea0SLionel SambucSpecifies the password source for the private key of the TSA. See
203ebfedea0SLionel SambucB<PASS PHRASE ARGUMENTS> in L<openssl(1)|openssl(1)>. (Optional)
204ebfedea0SLionel Sambuc
205ebfedea0SLionel Sambuc=item B<-signer> tsa_cert.pem
206ebfedea0SLionel Sambuc
207ebfedea0SLionel SambucThe signer certificate of the TSA in PEM format. The TSA signing
208ebfedea0SLionel Sambuccertificate must have exactly one extended key usage assigned to it:
209ebfedea0SLionel SambuctimeStamping. The extended key usage must also be critical, otherwise
210ebfedea0SLionel Sambucthe certificate is going to be refused. Overrides the B<signer_cert>
211ebfedea0SLionel Sambucvariable of the config file. (Optional)
212ebfedea0SLionel Sambuc
213ebfedea0SLionel Sambuc=item B<-inkey> private.pem
214ebfedea0SLionel Sambuc
215ebfedea0SLionel SambucThe signer private key of the TSA in PEM format. Overrides the
216ebfedea0SLionel SambucB<signer_key> config file option. (Optional)
217ebfedea0SLionel Sambuc
218ebfedea0SLionel Sambuc=item B<-chain> certs_file.pem
219ebfedea0SLionel Sambuc
220ebfedea0SLionel SambucThe collection of certificates in PEM format that will all
221ebfedea0SLionel Sambucbe included in the response in addition to the signer certificate if
222ebfedea0SLionel Sambucthe B<-cert> option was used for the request. This file is supposed to
223ebfedea0SLionel Sambuccontain the certificate chain for the signer certificate from its
224ebfedea0SLionel Sambucissuer upwards. The B<-reply> command does not build a certificate
225ebfedea0SLionel Sambucchain automatically. (Optional)
226ebfedea0SLionel Sambuc
227ebfedea0SLionel Sambuc=item B<-policy> object_id
228ebfedea0SLionel Sambuc
229ebfedea0SLionel SambucThe default policy to use for the response unless the client
230ebfedea0SLionel Sambucexplicitly requires a particular TSA policy. The OID can be specified
231ebfedea0SLionel Sambuceither in dotted notation or with its name. Overrides the
232ebfedea0SLionel SambucB<default_policy> config file option. (Optional)
233ebfedea0SLionel Sambuc
234ebfedea0SLionel Sambuc=item B<-in> response.tsr
235ebfedea0SLionel Sambuc
236ebfedea0SLionel SambucSpecifies a previously created time stamp response or time stamp token
237ebfedea0SLionel Sambuc(if B<-token_in> is also specified) in DER format that will be written
238ebfedea0SLionel Sambucto the output file. This option does not require a request, it is
239ebfedea0SLionel Sambucuseful e.g. when you need to examine the content of a response or
240ebfedea0SLionel Sambuctoken or you want to extract the time stamp token from a response. If
241ebfedea0SLionel Sambucthe input is a token and the output is a time stamp response a default
242ebfedea0SLionel Sambuc'granted' status info is added to the token. (Optional)
243ebfedea0SLionel Sambuc
244ebfedea0SLionel Sambuc=item B<-token_in>
245ebfedea0SLionel Sambuc
246ebfedea0SLionel SambucThis flag can be used together with the B<-in> option and indicates
247ebfedea0SLionel Sambucthat the input is a DER encoded time stamp token (ContentInfo) instead
248ebfedea0SLionel Sambucof a time stamp response (TimeStampResp). (Optional)
249ebfedea0SLionel Sambuc
250ebfedea0SLionel Sambuc=item B<-out> response.tsr
251ebfedea0SLionel Sambuc
252ebfedea0SLionel SambucThe response is written to this file. The format and content of the
253ebfedea0SLionel Sambucfile depends on other options (see B<-text>, B<-token_out>). The default is
254ebfedea0SLionel Sambucstdout. (Optional)
255ebfedea0SLionel Sambuc
256ebfedea0SLionel Sambuc=item B<-token_out>
257ebfedea0SLionel Sambuc
258ebfedea0SLionel SambucThe output is a time stamp token (ContentInfo) instead of time stamp
259ebfedea0SLionel Sambucresponse (TimeStampResp). (Optional)
260ebfedea0SLionel Sambuc
261ebfedea0SLionel Sambuc=item B<-text>
262ebfedea0SLionel Sambuc
263ebfedea0SLionel SambucIf this option is specified the output is human-readable text format
264ebfedea0SLionel Sambucinstead of DER. (Optional)
265ebfedea0SLionel Sambuc
266ebfedea0SLionel Sambuc=item B<-engine> id
267ebfedea0SLionel Sambuc
268ebfedea0SLionel SambucSpecifying an engine (by its unique B<id> string) will cause B<ts>
269ebfedea0SLionel Sambucto attempt to obtain a functional reference to the specified engine,
270ebfedea0SLionel Sambucthus initialising it if needed. The engine will then be set as the default
271ebfedea0SLionel Sambucfor all available algorithms. Default is builtin. (Optional)
272ebfedea0SLionel Sambuc
273ebfedea0SLionel Sambuc=back
274ebfedea0SLionel Sambuc
275ebfedea0SLionel Sambuc=head2 Time Stamp Response verification
276ebfedea0SLionel Sambuc
277ebfedea0SLionel SambucThe B<-verify> command is for verifying if a time stamp response or time
278ebfedea0SLionel Sambucstamp token is valid and matches a particular time stamp request or
279ebfedea0SLionel Sambucdata file. The B<-verify> command does not use the configuration file.
280ebfedea0SLionel Sambuc
281ebfedea0SLionel Sambuc=over 4
282ebfedea0SLionel Sambuc
283ebfedea0SLionel Sambuc=item B<-data> file_to_hash
284ebfedea0SLionel Sambuc
285ebfedea0SLionel SambucThe response or token must be verified against file_to_hash. The file
286ebfedea0SLionel Sambucis hashed with the message digest algorithm specified in the token.
287ebfedea0SLionel SambucThe B<-digest> and B<-queryfile> options must not be specified with this one.
288ebfedea0SLionel Sambuc(Optional)
289ebfedea0SLionel Sambuc
290ebfedea0SLionel Sambuc=item B<-digest> digest_bytes
291ebfedea0SLionel Sambuc
292ebfedea0SLionel SambucThe response or token must be verified against the message digest specified
293ebfedea0SLionel Sambucwith this option. The number of bytes must match the message digest algorithm
294ebfedea0SLionel Sambucspecified in the token. The B<-data> and B<-queryfile> options must not be
295ebfedea0SLionel Sambucspecified with this one. (Optional)
296ebfedea0SLionel Sambuc
297ebfedea0SLionel Sambuc=item B<-queryfile> request.tsq
298ebfedea0SLionel Sambuc
299ebfedea0SLionel SambucThe original time stamp request in DER format. The B<-data> and B<-digest>
300ebfedea0SLionel Sambucoptions must not be specified with this one. (Optional)
301ebfedea0SLionel Sambuc
302ebfedea0SLionel Sambuc=item B<-in> response.tsr
303ebfedea0SLionel Sambuc
304ebfedea0SLionel SambucThe time stamp response that needs to be verified in DER format. (Mandatory)
305ebfedea0SLionel Sambuc
306ebfedea0SLionel Sambuc=item B<-token_in>
307ebfedea0SLionel Sambuc
308ebfedea0SLionel SambucThis flag can be used together with the B<-in> option and indicates
309ebfedea0SLionel Sambucthat the input is a DER encoded time stamp token (ContentInfo) instead
310ebfedea0SLionel Sambucof a time stamp response (TimeStampResp). (Optional)
311ebfedea0SLionel Sambuc
312ebfedea0SLionel Sambuc=item B<-CApath> trusted_cert_path
313ebfedea0SLionel Sambuc
314ebfedea0SLionel SambucThe name of the directory containing the trused CA certificates of the
315ebfedea0SLionel Sambucclient. See the similar option of L<verify(1)|verify(1)> for additional
316ebfedea0SLionel Sambucdetails. Either this option or B<-CAfile> must be specified. (Optional)
317ebfedea0SLionel Sambuc
318ebfedea0SLionel Sambuc
319ebfedea0SLionel Sambuc=item B<-CAfile> trusted_certs.pem
320ebfedea0SLionel Sambuc
321ebfedea0SLionel SambucThe name of the file containing a set of trusted self-signed CA
322ebfedea0SLionel Sambuccertificates in PEM format. See the similar option of
323ebfedea0SLionel SambucL<verify(1)|verify(1)> for additional details. Either this option
324ebfedea0SLionel Sambucor B<-CApath> must be specified.
325ebfedea0SLionel Sambuc(Optional)
326ebfedea0SLionel Sambuc
327ebfedea0SLionel Sambuc=item B<-untrusted> cert_file.pem
328ebfedea0SLionel Sambuc
329ebfedea0SLionel SambucSet of additional untrusted certificates in PEM format which may be
330ebfedea0SLionel Sambucneeded when building the certificate chain for the TSA's signing
331ebfedea0SLionel Sambuccertificate. This file must contain the TSA signing certificate and
332ebfedea0SLionel Sambucall intermediate CA certificates unless the response includes them.
333ebfedea0SLionel Sambuc(Optional)
334ebfedea0SLionel Sambuc
335ebfedea0SLionel Sambuc=back
336ebfedea0SLionel Sambuc
337ebfedea0SLionel Sambuc=head1 CONFIGURATION FILE OPTIONS
338ebfedea0SLionel Sambuc
339ebfedea0SLionel SambucThe B<-query> and B<-reply> commands make use of a configuration file
340ebfedea0SLionel Sambucdefined by the B<OPENSSL_CONF> environment variable. See L<config(5)|config(5)>
341ebfedea0SLionel Sambucfor a general description of the syntax of the config file. The
342ebfedea0SLionel SambucB<-query> command uses only the symbolic OID names section
343ebfedea0SLionel Sambucand it can work without it. However, the B<-reply> command needs the
344ebfedea0SLionel Sambucconfig file for its operation.
345ebfedea0SLionel Sambuc
346ebfedea0SLionel SambucWhen there is a command line switch equivalent of a variable the
347ebfedea0SLionel Sambucswitch always overrides the settings in the config file.
348ebfedea0SLionel Sambuc
349ebfedea0SLionel Sambuc=over 4
350ebfedea0SLionel Sambuc
351ebfedea0SLionel Sambuc=item B<tsa> section, B<default_tsa>
352ebfedea0SLionel Sambuc
353ebfedea0SLionel SambucThis is the main section and it specifies the name of another section
354ebfedea0SLionel Sambucthat contains all the options for the B<-reply> command. This default
355*0a6a1f1dSLionel Sambucsection can be overridden with the B<-section> command line switch. (Optional)
356ebfedea0SLionel Sambuc
357ebfedea0SLionel Sambuc=item B<oid_file>
358ebfedea0SLionel Sambuc
359ebfedea0SLionel SambucSee L<ca(1)|ca(1)> for description. (Optional)
360ebfedea0SLionel Sambuc
361ebfedea0SLionel Sambuc=item B<oid_section>
362ebfedea0SLionel Sambuc
363ebfedea0SLionel SambucSee L<ca(1)|ca(1)> for description. (Optional)
364ebfedea0SLionel Sambuc
365ebfedea0SLionel Sambuc=item B<RANDFILE>
366ebfedea0SLionel Sambuc
367ebfedea0SLionel SambucSee L<ca(1)|ca(1)> for description. (Optional)
368ebfedea0SLionel Sambuc
369ebfedea0SLionel Sambuc=item B<serial>
370ebfedea0SLionel Sambuc
371ebfedea0SLionel SambucThe name of the file containing the hexadecimal serial number of the
372ebfedea0SLionel Sambuclast time stamp response created. This number is incremented by 1 for
373ebfedea0SLionel Sambuceach response. If the file does not exist at the time of response
374ebfedea0SLionel Sambucgeneration a new file is created with serial number 1. (Mandatory)
375ebfedea0SLionel Sambuc
376ebfedea0SLionel Sambuc=item B<crypto_device>
377ebfedea0SLionel Sambuc
378ebfedea0SLionel SambucSpecifies the OpenSSL engine that will be set as the default for
379ebfedea0SLionel Sambucall available algorithms. The default value is builtin, you can specify
380ebfedea0SLionel Sambucany other engines supported by OpenSSL (e.g. use chil for the NCipher HSM).
381ebfedea0SLionel Sambuc(Optional)
382ebfedea0SLionel Sambuc
383ebfedea0SLionel Sambuc=item B<signer_cert>
384ebfedea0SLionel Sambuc
385ebfedea0SLionel SambucTSA signing certificate in PEM format. The same as the B<-signer>
386ebfedea0SLionel Sambuccommand line option. (Optional)
387ebfedea0SLionel Sambuc
388ebfedea0SLionel Sambuc=item B<certs>
389ebfedea0SLionel Sambuc
390ebfedea0SLionel SambucA file containing a set of PEM encoded certificates that need to be
391ebfedea0SLionel Sambucincluded in the response. The same as the B<-chain> command line
392ebfedea0SLionel Sambucoption. (Optional)
393ebfedea0SLionel Sambuc
394ebfedea0SLionel Sambuc=item B<signer_key>
395ebfedea0SLionel Sambuc
396ebfedea0SLionel SambucThe private key of the TSA in PEM format. The same as the B<-inkey>
397ebfedea0SLionel Sambuccommand line option. (Optional)
398ebfedea0SLionel Sambuc
399ebfedea0SLionel Sambuc=item B<default_policy>
400ebfedea0SLionel Sambuc
401ebfedea0SLionel SambucThe default policy to use when the request does not mandate any
402ebfedea0SLionel Sambucpolicy. The same as the B<-policy> command line option. (Optional)
403ebfedea0SLionel Sambuc
404ebfedea0SLionel Sambuc=item B<other_policies>
405ebfedea0SLionel Sambuc
406ebfedea0SLionel SambucComma separated list of policies that are also acceptable by the TSA
407ebfedea0SLionel Sambucand used only if the request explicitly specifies one of them. (Optional)
408ebfedea0SLionel Sambuc
409ebfedea0SLionel Sambuc=item B<digests>
410ebfedea0SLionel Sambuc
411ebfedea0SLionel SambucThe list of message digest algorithms that the TSA accepts. At least
412ebfedea0SLionel Sambucone algorithm must be specified. (Mandatory)
413ebfedea0SLionel Sambuc
414ebfedea0SLionel Sambuc=item B<accuracy>
415ebfedea0SLionel Sambuc
416ebfedea0SLionel SambucThe accuracy of the time source of the TSA in seconds, milliseconds
417ebfedea0SLionel Sambucand microseconds. E.g. secs:1, millisecs:500, microsecs:100. If any of
418ebfedea0SLionel Sambucthe components is missing zero is assumed for that field. (Optional)
419ebfedea0SLionel Sambuc
420ebfedea0SLionel Sambuc=item B<clock_precision_digits>
421ebfedea0SLionel Sambuc
422ebfedea0SLionel SambucSpecifies the maximum number of digits, which represent the fraction of
423ebfedea0SLionel Sambucseconds, that  need to be included in the time field. The trailing zeroes
424ebfedea0SLionel Sambucmust be removed from the time, so there might actually be fewer digits,
425ebfedea0SLionel Sambucor no fraction of seconds at all. Supported only on UNIX platforms.
426ebfedea0SLionel SambucThe maximum value is 6, default is 0.
427ebfedea0SLionel Sambuc(Optional)
428ebfedea0SLionel Sambuc
429ebfedea0SLionel Sambuc=item B<ordering>
430ebfedea0SLionel Sambuc
431ebfedea0SLionel SambucIf this option is yes the responses generated by this TSA can always
432ebfedea0SLionel Sambucbe ordered, even if the time difference between two responses is less
433ebfedea0SLionel Sambucthan the sum of their accuracies. Default is no. (Optional)
434ebfedea0SLionel Sambuc
435ebfedea0SLionel Sambuc=item B<tsa_name>
436ebfedea0SLionel Sambuc
437ebfedea0SLionel SambucSet this option to yes if the subject name of the TSA must be included in
438ebfedea0SLionel Sambucthe TSA name field of the response. Default is no. (Optional)
439ebfedea0SLionel Sambuc
440ebfedea0SLionel Sambuc=item B<ess_cert_id_chain>
441ebfedea0SLionel Sambuc
442ebfedea0SLionel SambucThe SignedData objects created by the TSA always contain the
443ebfedea0SLionel Sambuccertificate identifier of the signing certificate in a signed
444ebfedea0SLionel Sambucattribute (see RFC 2634, Enhanced Security Services). If this option
445ebfedea0SLionel Sambucis set to yes and either the B<certs> variable or the B<-chain> option
446ebfedea0SLionel Sambucis specified then the certificate identifiers of the chain will also
447ebfedea0SLionel Sambucbe included in the SigningCertificate signed attribute. If this
448ebfedea0SLionel Sambucvariable is set to no, only the signing certificate identifier is
449ebfedea0SLionel Sambucincluded. Default is no. (Optional)
450ebfedea0SLionel Sambuc
451ebfedea0SLionel Sambuc=back
452ebfedea0SLionel Sambuc
453ebfedea0SLionel Sambuc=head1 ENVIRONMENT VARIABLES
454ebfedea0SLionel Sambuc
455ebfedea0SLionel SambucB<OPENSSL_CONF> contains the path of the configuration file and can be
456*0a6a1f1dSLionel Sambucoverridden by the B<-config> command line option.
457ebfedea0SLionel Sambuc
458ebfedea0SLionel Sambuc=head1 EXAMPLES
459ebfedea0SLionel Sambuc
460ebfedea0SLionel SambucAll the examples below presume that B<OPENSSL_CONF> is set to a proper
461ebfedea0SLionel Sambucconfiguration file, e.g. the example configuration file
462ebfedea0SLionel Sambucopenssl/apps/openssl.cnf will do.
463ebfedea0SLionel Sambuc
464ebfedea0SLionel Sambuc=head2 Time Stamp Request
465ebfedea0SLionel Sambuc
466ebfedea0SLionel SambucTo create a time stamp request for design1.txt with SHA-1
467ebfedea0SLionel Sambucwithout nonce and policy and no certificate is required in the response:
468ebfedea0SLionel Sambuc
469ebfedea0SLionel Sambuc  openssl ts -query -data design1.txt -no_nonce \
470ebfedea0SLionel Sambuc	-out design1.tsq
471ebfedea0SLionel Sambuc
472ebfedea0SLionel SambucTo create a similar time stamp request with specifying the message imprint
473ebfedea0SLionel Sambucexplicitly:
474ebfedea0SLionel Sambuc
475ebfedea0SLionel Sambuc  openssl ts -query -digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \
476ebfedea0SLionel Sambuc	 -no_nonce -out design1.tsq
477ebfedea0SLionel Sambuc
478ebfedea0SLionel SambucTo print the content of the previous request in human readable format:
479ebfedea0SLionel Sambuc
480ebfedea0SLionel Sambuc  openssl ts -query -in design1.tsq -text
481ebfedea0SLionel Sambuc
482ebfedea0SLionel SambucTo create a time stamp request which includes the MD-5 digest
483ebfedea0SLionel Sambucof design2.txt, requests the signer certificate and nonce,
484ebfedea0SLionel Sambucspecifies a policy id (assuming the tsa_policy1 name is defined in the
485ebfedea0SLionel SambucOID section of the config file):
486ebfedea0SLionel Sambuc
487ebfedea0SLionel Sambuc  openssl ts -query -data design2.txt -md5 \
488ebfedea0SLionel Sambuc	-policy tsa_policy1 -cert -out design2.tsq
489ebfedea0SLionel Sambuc
490ebfedea0SLionel Sambuc=head2 Time Stamp Response
491ebfedea0SLionel Sambuc
492ebfedea0SLionel SambucBefore generating a response a signing certificate must be created for
493ebfedea0SLionel Sambucthe TSA that contains the B<timeStamping> critical extended key usage extension
494ebfedea0SLionel Sambucwithout any other key usage extensions. You can add the
495ebfedea0SLionel Sambuc'extendedKeyUsage = critical,timeStamping' line to the user certificate section
496ebfedea0SLionel Sambucof the config file to generate a proper certificate. See L<req(1)|req(1)>,
497ebfedea0SLionel SambucL<ca(1)|ca(1)>, L<x509(1)|x509(1)> for instructions. The examples
498ebfedea0SLionel Sambucbelow assume that cacert.pem contains the certificate of the CA,
499ebfedea0SLionel Sambuctsacert.pem is the signing certificate issued by cacert.pem and
500ebfedea0SLionel Sambuctsakey.pem is the private key of the TSA.
501ebfedea0SLionel Sambuc
502ebfedea0SLionel SambucTo create a time stamp response for a request:
503ebfedea0SLionel Sambuc
504ebfedea0SLionel Sambuc  openssl ts -reply -queryfile design1.tsq -inkey tsakey.pem \
505ebfedea0SLionel Sambuc	-signer tsacert.pem -out design1.tsr
506ebfedea0SLionel Sambuc
507ebfedea0SLionel SambucIf you want to use the settings in the config file you could just write:
508ebfedea0SLionel Sambuc
509ebfedea0SLionel Sambuc  openssl ts -reply -queryfile design1.tsq -out design1.tsr
510ebfedea0SLionel Sambuc
511ebfedea0SLionel SambucTo print a time stamp reply to stdout in human readable format:
512ebfedea0SLionel Sambuc
513ebfedea0SLionel Sambuc  openssl ts -reply -in design1.tsr -text
514ebfedea0SLionel Sambuc
515ebfedea0SLionel SambucTo create a time stamp token instead of time stamp response:
516ebfedea0SLionel Sambuc
517ebfedea0SLionel Sambuc  openssl ts -reply -queryfile design1.tsq -out design1_token.der -token_out
518ebfedea0SLionel Sambuc
519ebfedea0SLionel SambucTo print a time stamp token to stdout in human readable format:
520ebfedea0SLionel Sambuc
521ebfedea0SLionel Sambuc  openssl ts -reply -in design1_token.der -token_in -text -token_out
522ebfedea0SLionel Sambuc
523ebfedea0SLionel SambucTo extract the time stamp token from a response:
524ebfedea0SLionel Sambuc
525ebfedea0SLionel Sambuc  openssl ts -reply -in design1.tsr -out design1_token.der -token_out
526ebfedea0SLionel Sambuc
527ebfedea0SLionel SambucTo add 'granted' status info to a time stamp token thereby creating a
528ebfedea0SLionel Sambucvalid response:
529ebfedea0SLionel Sambuc
530ebfedea0SLionel Sambuc  openssl ts -reply -in design1_token.der -token_in -out design1.tsr
531ebfedea0SLionel Sambuc
532ebfedea0SLionel Sambuc=head2 Time Stamp Verification
533ebfedea0SLionel Sambuc
534ebfedea0SLionel SambucTo verify a time stamp reply against a request:
535ebfedea0SLionel Sambuc
536ebfedea0SLionel Sambuc  openssl ts -verify -queryfile design1.tsq -in design1.tsr \
537ebfedea0SLionel Sambuc	-CAfile cacert.pem -untrusted tsacert.pem
538ebfedea0SLionel Sambuc
539ebfedea0SLionel SambucTo verify a time stamp reply that includes the certificate chain:
540ebfedea0SLionel Sambuc
541ebfedea0SLionel Sambuc  openssl ts -verify -queryfile design2.tsq -in design2.tsr \
542ebfedea0SLionel Sambuc	-CAfile cacert.pem
543ebfedea0SLionel Sambuc
544ebfedea0SLionel SambucTo verify a time stamp token against the original data file:
545ebfedea0SLionel Sambuc  openssl ts -verify -data design2.txt -in design2.tsr \
546ebfedea0SLionel Sambuc	-CAfile cacert.pem
547ebfedea0SLionel Sambuc
548ebfedea0SLionel SambucTo verify a time stamp token against a message imprint:
549ebfedea0SLionel Sambuc  openssl ts -verify -digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \
550ebfedea0SLionel Sambuc	 -in design2.tsr -CAfile cacert.pem
551ebfedea0SLionel Sambuc
552ebfedea0SLionel SambucYou could also look at the 'test' directory for more examples.
553ebfedea0SLionel Sambuc
554ebfedea0SLionel Sambuc=head1 BUGS
555ebfedea0SLionel Sambuc
556ebfedea0SLionel SambucIf you find any bugs or you have suggestions please write to
557ebfedea0SLionel SambucZoltan Glozik <zglozik@opentsa.org>. Known issues:
558ebfedea0SLionel Sambuc
559ebfedea0SLionel Sambuc=over 4
560ebfedea0SLionel Sambuc
561ebfedea0SLionel Sambuc=item * No support for time stamps over SMTP, though it is quite easy
562ebfedea0SLionel Sambucto implement an automatic e-mail based TSA with L<procmail(1)|procmail(1)>
563ebfedea0SLionel Sambucand L<perl(1)|perl(1)>. HTTP server support is provided in the form of
564ebfedea0SLionel Sambuca separate apache module. HTTP client support is provided by
565ebfedea0SLionel SambucL<tsget(1)|tsget(1)>. Pure TCP/IP protocol is not supported.
566ebfedea0SLionel Sambuc
567ebfedea0SLionel Sambuc=item * The file containing the last serial number of the TSA is not
568ebfedea0SLionel Sambuclocked when being read or written. This is a problem if more than one
569ebfedea0SLionel Sambucinstance of L<openssl(1)|openssl(1)> is trying to create a time stamp
570ebfedea0SLionel Sambucresponse at the same time. This is not an issue when using the apache
571ebfedea0SLionel Sambucserver module, it does proper locking.
572ebfedea0SLionel Sambuc
573ebfedea0SLionel Sambuc=item * Look for the FIXME word in the source files.
574ebfedea0SLionel Sambuc
575ebfedea0SLionel Sambuc=item * The source code should really be reviewed by somebody else, too.
576ebfedea0SLionel Sambuc
577ebfedea0SLionel Sambuc=item * More testing is needed, I have done only some basic tests (see
578ebfedea0SLionel Sambuctest/testtsa).
579ebfedea0SLionel Sambuc
580ebfedea0SLionel Sambuc=back
581ebfedea0SLionel Sambuc
582ebfedea0SLionel Sambuc=cut
583ebfedea0SLionel Sambuc
584ebfedea0SLionel Sambuc=head1 AUTHOR
585ebfedea0SLionel Sambuc
586ebfedea0SLionel SambucZoltan Glozik <zglozik@opentsa.org>, OpenTSA project (http://www.opentsa.org)
587ebfedea0SLionel Sambuc
588ebfedea0SLionel Sambuc=head1 SEE ALSO
589ebfedea0SLionel Sambuc
590ebfedea0SLionel SambucL<tsget(1)|tsget(1)>, L<openssl(1)|openssl(1)>, L<req(1)|req(1)>,
591ebfedea0SLionel SambucL<x509(1)|x509(1)>, L<ca(1)|ca(1)>, L<genrsa(1)|genrsa(1)>,
592ebfedea0SLionel SambucL<config(5)|config(5)>
593ebfedea0SLionel Sambuc
594ebfedea0SLionel Sambuc=cut
595