Blame doc/man1/ts.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
openssl-ts,
Packit c4476c
ts - Time Stamping Authority tool (client/server)
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
B<openssl> B<ts>
Packit c4476c
B<-query>
Packit c4476c
[B<-rand file...>]
Packit c4476c
[B<-writerand file>]
Packit c4476c
[B<-config> configfile]
Packit c4476c
[B<-data> file_to_hash]
Packit c4476c
[B<-digest> digest_bytes]
Packit c4476c
[B<-I<digest>>]
Packit c4476c
[B<-tspolicy> object_id]
Packit c4476c
[B<-no_nonce>]
Packit c4476c
[B<-cert>]
Packit c4476c
[B<-in> request.tsq]
Packit c4476c
[B<-out> request.tsq]
Packit c4476c
[B<-text>]
Packit c4476c
Packit c4476c
B<openssl> B<ts>
Packit c4476c
B<-reply>
Packit c4476c
[B<-config> configfile]
Packit c4476c
[B<-section> tsa_section]
Packit c4476c
[B<-queryfile> request.tsq]
Packit c4476c
[B<-passin> password_src]
Packit c4476c
[B<-signer> tsa_cert.pem]
Packit c4476c
[B<-inkey> file_or_id]
Packit c4476c
[B<-I<digest>>]
Packit c4476c
[B<-chain> certs_file.pem]
Packit c4476c
[B<-tspolicy> object_id]
Packit c4476c
[B<-in> response.tsr]
Packit c4476c
[B<-token_in>]
Packit c4476c
[B<-out> response.tsr]
Packit c4476c
[B<-token_out>]
Packit c4476c
[B<-text>]
Packit c4476c
[B<-engine> id]
Packit c4476c
Packit c4476c
B<openssl> B<ts>
Packit c4476c
B<-verify>
Packit c4476c
[B<-data> file_to_hash]
Packit c4476c
[B<-digest> digest_bytes]
Packit c4476c
[B<-queryfile> request.tsq]
Packit c4476c
[B<-in> response.tsr]
Packit c4476c
[B<-token_in>]
Packit c4476c
[B<-CApath> trusted_cert_path]
Packit c4476c
[B<-CAfile> trusted_certs.pem]
Packit c4476c
[B<-untrusted> cert_file.pem]
Packit c4476c
[I<verify options>]
Packit c4476c
Packit c4476c
I<verify options:>
Packit c4476c
[-attime timestamp]
Packit c4476c
[-check_ss_sig]
Packit c4476c
[-crl_check]
Packit c4476c
[-crl_check_all]
Packit c4476c
[-explicit_policy]
Packit c4476c
[-extended_crl]
Packit c4476c
[-ignore_critical]
Packit c4476c
[-inhibit_any]
Packit c4476c
[-inhibit_map]
Packit c4476c
[-issuer_checks]
Packit c4476c
[-no_alt_chains]
Packit c4476c
[-no_check_time]
Packit c4476c
[-partial_chain]
Packit c4476c
[-policy arg]
Packit c4476c
[-policy_check]
Packit c4476c
[-policy_print]
Packit c4476c
[-purpose purpose]
Packit c4476c
[-suiteB_128]
Packit c4476c
[-suiteB_128_only]
Packit c4476c
[-suiteB_192]
Packit c4476c
[-trusted_first]
Packit c4476c
[-use_deltas]
Packit c4476c
[-auth_level num]
Packit c4476c
[-verify_depth num]
Packit c4476c
[-verify_email email]
Packit c4476c
[-verify_hostname hostname]
Packit c4476c
[-verify_ip ip]
Packit c4476c
[-verify_name name]
Packit c4476c
[-x509_strict]
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
The B<ts> command is a basic Time Stamping Authority (TSA) client and server
Packit c4476c
application as specified in RFC 3161 (Time-Stamp Protocol, TSP). A
Packit c4476c
TSA can be part of a PKI deployment and its role is to provide long
Packit c4476c
term proof of the existence of a certain datum before a particular
Packit c4476c
time. Here is a brief description of the protocol:
Packit c4476c
Packit c4476c
=over 4
Packit c4476c
Packit c4476c
=item 1.
Packit c4476c
Packit c4476c
The TSA client computes a one-way hash value for a data file and sends
Packit c4476c
the hash to the TSA.
Packit c4476c
Packit c4476c
=item 2.
Packit c4476c
Packit c4476c
The TSA attaches the current date and time to the received hash value,
Packit c4476c
signs them and sends the time stamp token back to the client. By
Packit c4476c
creating this token the TSA certifies the existence of the original
Packit c4476c
data file at the time of response generation.
Packit c4476c
Packit c4476c
=item 3.
Packit c4476c
Packit c4476c
The TSA client receives the time stamp token and verifies the
Packit c4476c
signature on it. It also checks if the token contains the same hash
Packit c4476c
value that it had sent to the TSA.
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
There is one DER encoded protocol data unit defined for transporting a time
Packit c4476c
stamp request to the TSA and one for sending the time stamp response
Packit c4476c
back to the client. The B<ts> command has three main functions:
Packit c4476c
creating a time stamp request based on a data file,
Packit c4476c
creating a time stamp response based on a request, verifying if a
Packit c4476c
response corresponds to a particular request or a data file.
Packit c4476c
Packit c4476c
There is no support for sending the requests/responses automatically
Packit c4476c
over HTTP or TCP yet as suggested in RFC 3161. The users must send the
Packit c4476c
requests either by ftp or e-mail.
Packit c4476c
Packit c4476c
=head1 OPTIONS
Packit c4476c
Packit c4476c
=head2 Time Stamp Request generation
Packit c4476c
Packit c4476c
The B<-query> switch can be used for creating and printing a time stamp
Packit c4476c
request with the following options:
Packit c4476c
Packit c4476c
=over 4
Packit c4476c
Packit c4476c
=item B<-rand file...>
Packit c4476c
Packit c4476c
A file or files containing random data used to seed the random number
Packit c4476c
generator.
Packit c4476c
Multiple files can be specified separated by an OS-dependent character.
Packit c4476c
The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
Packit c4476c
all others.
Packit c4476c
Packit c4476c
=item [B<-writerand file>]
Packit c4476c
Packit c4476c
Writes random data to the specified I<file> upon exit.
Packit c4476c
This can be used with a subsequent B<-rand> flag.
Packit c4476c
Packit c4476c
=item B<-config> configfile
Packit c4476c
Packit c4476c
The configuration file to use.
Packit c4476c
Optional; for a description of the default value,
Packit c4476c
see L<openssl(1)/COMMAND SUMMARY>.
Packit c4476c
Packit c4476c
=item B<-data> file_to_hash
Packit c4476c
Packit c4476c
The data file for which the time stamp request needs to be
Packit c4476c
created. stdin is the default if neither the B<-data> nor the B<-digest>
Packit c4476c
parameter is specified. (Optional)
Packit c4476c
Packit c4476c
=item B<-digest> digest_bytes
Packit c4476c
Packit c4476c
It is possible to specify the message imprint explicitly without the data
Packit c4476c
file. The imprint must be specified in a hexadecimal format, two characters
Packit c4476c
per byte, the bytes optionally separated by colons (e.g. 1A:F6:01:... or
Packit c4476c
1AF601...). The number of bytes must match the message digest algorithm
Packit c4476c
in use. (Optional)
Packit c4476c
Packit c4476c
=item B<-I<digest>>
Packit c4476c
Packit c4476c
The message digest to apply to the data file.
Packit c4476c
Any digest supported by the OpenSSL B<dgst> command can be used.
Packit c4476c
The default is SHA-1. (Optional)
Packit c4476c
Packit c4476c
=item B<-tspolicy> object_id
Packit c4476c
Packit c4476c
The policy that the client expects the TSA to use for creating the
Packit c4476c
time stamp token. Either the dotted OID notation or OID names defined
Packit c4476c
in the config file can be used. If no policy is requested the TSA will
Packit c4476c
use its own default policy. (Optional)
Packit c4476c
Packit c4476c
=item B<-no_nonce>
Packit c4476c
Packit c4476c
No nonce is specified in the request if this option is
Packit c4476c
given. Otherwise a 64 bit long pseudo-random none is
Packit c4476c
included in the request. It is recommended to use nonce to
Packit c4476c
protect against replay-attacks. (Optional)
Packit c4476c
Packit c4476c
=item B<-cert>
Packit c4476c
Packit c4476c
The TSA is expected to include its signing certificate in the
Packit c4476c
response. (Optional)
Packit c4476c
Packit c4476c
=item B<-in> request.tsq
Packit c4476c
Packit c4476c
This option specifies a previously created time stamp request in DER
Packit c4476c
format that will be printed into the output file. Useful when you need
Packit c4476c
to examine the content of a request in human-readable
Packit c4476c
format. (Optional)
Packit c4476c
Packit c4476c
=item B<-out> request.tsq
Packit c4476c
Packit c4476c
Name of the output file to which the request will be written. Default
Packit c4476c
is stdout. (Optional)
Packit c4476c
Packit c4476c
=item B<-text>
Packit c4476c
Packit c4476c
If this option is specified the output is human-readable text format
Packit c4476c
instead of DER. (Optional)
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
=head2 Time Stamp Response generation
Packit c4476c
Packit c4476c
A time stamp response (TimeStampResp) consists of a response status
Packit c4476c
and the time stamp token itself (ContentInfo), if the token generation was
Packit c4476c
successful. The B<-reply> command is for creating a time stamp
Packit c4476c
response or time stamp token based on a request and printing the
Packit c4476c
response/token in human-readable format. If B<-token_out> is not
Packit c4476c
specified the output is always a time stamp response (TimeStampResp),
Packit c4476c
otherwise it is a time stamp token (ContentInfo).
Packit c4476c
Packit c4476c
=over 4
Packit c4476c
Packit c4476c
=item B<-config> configfile
Packit c4476c
Packit c4476c
The configuration file to use.
Packit c4476c
Optional; for a description of the default value,
Packit c4476c
see L<openssl(1)/COMMAND SUMMARY>.
Packit c4476c
See B<CONFIGURATION FILE OPTIONS> for configurable variables.
Packit c4476c
Packit c4476c
=item B<-section> tsa_section
Packit c4476c
Packit c4476c
The name of the config file section containing the settings for the
Packit c4476c
response generation. If not specified the default TSA section is
Packit c4476c
used, see B<CONFIGURATION FILE OPTIONS> for details. (Optional)
Packit c4476c
Packit c4476c
=item B<-queryfile> request.tsq
Packit c4476c
Packit c4476c
The name of the file containing a DER encoded time stamp request. (Optional)
Packit c4476c
Packit c4476c
=item B<-passin> password_src
Packit c4476c
Packit c4476c
Specifies the password source for the private key of the TSA. See
Packit c4476c
B<PASS PHRASE ARGUMENTS> in L<openssl(1)>. (Optional)
Packit c4476c
Packit c4476c
=item B<-signer> tsa_cert.pem
Packit c4476c
Packit c4476c
The signer certificate of the TSA in PEM format. The TSA signing
Packit c4476c
certificate must have exactly one extended key usage assigned to it:
Packit c4476c
timeStamping. The extended key usage must also be critical, otherwise
Packit c4476c
the certificate is going to be refused. Overrides the B<signer_cert>
Packit c4476c
variable of the config file. (Optional)
Packit c4476c
Packit c4476c
=item B<-inkey> file_or_id
Packit c4476c
Packit c4476c
The signer private key of the TSA in PEM format. Overrides the
Packit c4476c
B<signer_key> config file option. (Optional)
Packit c4476c
If no engine is used, the argument is taken as a file; if an engine is
Packit c4476c
specified, the argument is given to the engine as a key identifier.
Packit c4476c
Packit c4476c
=item B<-I<digest>>
Packit c4476c
Packit c4476c
Signing digest to use. Overrides the B<signer_digest> config file
Packit c4476c
option. (Mandatory unless specified in the config file)
Packit c4476c
Packit c4476c
=item B<-chain> certs_file.pem
Packit c4476c
Packit c4476c
The collection of certificates in PEM format that will all
Packit c4476c
be included in the response in addition to the signer certificate if
Packit c4476c
the B<-cert> option was used for the request. This file is supposed to
Packit c4476c
contain the certificate chain for the signer certificate from its
Packit c4476c
issuer upwards. The B<-reply> command does not build a certificate
Packit c4476c
chain automatically. (Optional)
Packit c4476c
Packit c4476c
=item B<-tspolicy> object_id
Packit c4476c
Packit c4476c
The default policy to use for the response unless the client
Packit c4476c
explicitly requires a particular TSA policy. The OID can be specified
Packit c4476c
either in dotted notation or with its name. Overrides the
Packit c4476c
B<default_policy> config file option. (Optional)
Packit c4476c
Packit c4476c
=item B<-in> response.tsr
Packit c4476c
Packit c4476c
Specifies a previously created time stamp response or time stamp token
Packit c4476c
(if B<-token_in> is also specified) in DER format that will be written
Packit c4476c
to the output file. This option does not require a request, it is
Packit c4476c
useful e.g. when you need to examine the content of a response or
Packit c4476c
token or you want to extract the time stamp token from a response. If
Packit c4476c
the input is a token and the output is a time stamp response a default
Packit c4476c
'granted' status info is added to the token. (Optional)
Packit c4476c
Packit c4476c
=item B<-token_in>
Packit c4476c
Packit c4476c
This flag can be used together with the B<-in> option and indicates
Packit c4476c
that the input is a DER encoded time stamp token (ContentInfo) instead
Packit c4476c
of a time stamp response (TimeStampResp). (Optional)
Packit c4476c
Packit c4476c
=item B<-out> response.tsr
Packit c4476c
Packit c4476c
The response is written to this file. The format and content of the
Packit c4476c
file depends on other options (see B<-text>, B<-token_out>). The default is
Packit c4476c
stdout. (Optional)
Packit c4476c
Packit c4476c
=item B<-token_out>
Packit c4476c
Packit c4476c
The output is a time stamp token (ContentInfo) instead of time stamp
Packit c4476c
response (TimeStampResp). (Optional)
Packit c4476c
Packit c4476c
=item B<-text>
Packit c4476c
Packit c4476c
If this option is specified the output is human-readable text format
Packit c4476c
instead of DER. (Optional)
Packit c4476c
Packit c4476c
=item B<-engine> id
Packit c4476c
Packit c4476c
Specifying an engine (by its unique B<id> string) will cause B<ts>
Packit c4476c
to attempt to obtain a functional reference to the specified engine,
Packit c4476c
thus initialising it if needed. The engine will then be set as the default
Packit c4476c
for all available algorithms. Default is builtin. (Optional)
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
=head2 Time Stamp Response verification
Packit c4476c
Packit c4476c
The B<-verify> command is for verifying if a time stamp response or time
Packit c4476c
stamp token is valid and matches a particular time stamp request or
Packit c4476c
data file. The B<-verify> command does not use the configuration file.
Packit c4476c
Packit c4476c
=over 4
Packit c4476c
Packit c4476c
=item B<-data> file_to_hash
Packit c4476c
Packit c4476c
The response or token must be verified against file_to_hash. The file
Packit c4476c
is hashed with the message digest algorithm specified in the token.
Packit c4476c
The B<-digest> and B<-queryfile> options must not be specified with this one.
Packit c4476c
(Optional)
Packit c4476c
Packit c4476c
=item B<-digest> digest_bytes
Packit c4476c
Packit c4476c
The response or token must be verified against the message digest specified
Packit c4476c
with this option. The number of bytes must match the message digest algorithm
Packit c4476c
specified in the token. The B<-data> and B<-queryfile> options must not be
Packit c4476c
specified with this one. (Optional)
Packit c4476c
Packit c4476c
=item B<-queryfile> request.tsq
Packit c4476c
Packit c4476c
The original time stamp request in DER format. The B<-data> and B<-digest>
Packit c4476c
options must not be specified with this one. (Optional)
Packit c4476c
Packit c4476c
=item B<-in> response.tsr
Packit c4476c
Packit c4476c
The time stamp response that needs to be verified in DER format. (Mandatory)
Packit c4476c
Packit c4476c
=item B<-token_in>
Packit c4476c
Packit c4476c
This flag can be used together with the B<-in> option and indicates
Packit c4476c
that the input is a DER encoded time stamp token (ContentInfo) instead
Packit c4476c
of a time stamp response (TimeStampResp). (Optional)
Packit c4476c
Packit c4476c
=item B<-CApath> trusted_cert_path
Packit c4476c
Packit c4476c
The name of the directory containing the trusted CA certificates of the
Packit c4476c
client. See the similar option of L<verify(1)> for additional
Packit c4476c
details. Either this option or B<-CAfile> must be specified. (Optional)
Packit c4476c
Packit c4476c
Packit c4476c
=item B<-CAfile> trusted_certs.pem
Packit c4476c
Packit c4476c
The name of the file containing a set of trusted self-signed CA
Packit c4476c
certificates in PEM format. See the similar option of
Packit c4476c
L<verify(1)> for additional details. Either this option
Packit c4476c
or B<-CApath> must be specified.
Packit c4476c
(Optional)
Packit c4476c
Packit c4476c
=item B<-untrusted> cert_file.pem
Packit c4476c
Packit c4476c
Set of additional untrusted certificates in PEM format which may be
Packit c4476c
needed when building the certificate chain for the TSA's signing
Packit c4476c
certificate. This file must contain the TSA signing certificate and
Packit c4476c
all intermediate CA certificates unless the response includes them.
Packit c4476c
(Optional)
Packit c4476c
Packit c4476c
=item I<verify options>
Packit c4476c
Packit c4476c
The options B<-attime timestamp>, B<-check_ss_sig>, B<-crl_check>,
Packit c4476c
B<-crl_check_all>, B<-explicit_policy>, B<-extended_crl>, B<-ignore_critical>,
Packit c4476c
B<-inhibit_any>, B<-inhibit_map>, B<-issuer_checks>, B<-no_alt_chains>,
Packit c4476c
B<-no_check_time>, B<-partial_chain>, B<-policy>, B<-policy_check>,
Packit c4476c
B<-policy_print>, B<-purpose>, B<-suiteB_128>, B<-suiteB_128_only>,
Packit c4476c
B<-suiteB_192>, B<-trusted_first>, B<-use_deltas>, B<-auth_level>,
Packit c4476c
B<-verify_depth>, B<-verify_email>, B<-verify_hostname>, B<-verify_ip>,
Packit c4476c
B<-verify_name>, and B<-x509_strict> can be used to control timestamp
Packit c4476c
verification.  See L<verify(1)>.
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
=head1 CONFIGURATION FILE OPTIONS
Packit c4476c
Packit c4476c
The B<-query> and B<-reply> commands make use of a configuration file.
Packit c4476c
See L<config(5)>
Packit c4476c
for a general description of the syntax of the config file. The
Packit c4476c
B<-query> command uses only the symbolic OID names section
Packit c4476c
and it can work without it. However, the B<-reply> command needs the
Packit c4476c
config file for its operation.
Packit c4476c
Packit c4476c
When there is a command line switch equivalent of a variable the
Packit c4476c
switch always overrides the settings in the config file.
Packit c4476c
Packit c4476c
=over 4
Packit c4476c
Packit c4476c
=item B<tsa> section, B<default_tsa>
Packit c4476c
Packit c4476c
This is the main section and it specifies the name of another section
Packit c4476c
that contains all the options for the B<-reply> command. This default
Packit c4476c
section can be overridden with the B<-section> command line switch. (Optional)
Packit c4476c
Packit c4476c
=item B<oid_file>
Packit c4476c
Packit c4476c
See L<ca(1)> for description. (Optional)
Packit c4476c
Packit c4476c
=item B<oid_section>
Packit c4476c
Packit c4476c
See L<ca(1)> for description. (Optional)
Packit c4476c
Packit c4476c
=item B<RANDFILE>
Packit c4476c
Packit c4476c
See L<ca(1)> for description. (Optional)
Packit c4476c
Packit c4476c
=item B<serial>
Packit c4476c
Packit c4476c
The name of the file containing the hexadecimal serial number of the
Packit c4476c
last time stamp response created. This number is incremented by 1 for
Packit c4476c
each response. If the file does not exist at the time of response
Packit c4476c
generation a new file is created with serial number 1. (Mandatory)
Packit c4476c
Packit c4476c
=item B<crypto_device>
Packit c4476c
Packit c4476c
Specifies the OpenSSL engine that will be set as the default for
Packit c4476c
all available algorithms. The default value is builtin, you can specify
Packit c4476c
any other engines supported by OpenSSL (e.g. use chil for the NCipher HSM).
Packit c4476c
(Optional)
Packit c4476c
Packit c4476c
=item B<signer_cert>
Packit c4476c
Packit c4476c
TSA signing certificate in PEM format. The same as the B<-signer>
Packit c4476c
command line option. (Optional)
Packit c4476c
Packit c4476c
=item B<certs>
Packit c4476c
Packit c4476c
A file containing a set of PEM encoded certificates that need to be
Packit c4476c
included in the response. The same as the B<-chain> command line
Packit c4476c
option. (Optional)
Packit c4476c
Packit c4476c
=item B<signer_key>
Packit c4476c
Packit c4476c
The private key of the TSA in PEM format. The same as the B<-inkey>
Packit c4476c
command line option. (Optional)
Packit c4476c
Packit c4476c
=item B<signer_digest>
Packit c4476c
Packit c4476c
Signing digest to use. The same as the
Packit c4476c
B<-I<digest>> command line option. (Mandatory unless specified on the command
Packit c4476c
line)
Packit c4476c
Packit c4476c
=item B<default_policy>
Packit c4476c
Packit c4476c
The default policy to use when the request does not mandate any
Packit c4476c
policy. The same as the B<-tspolicy> command line option. (Optional)
Packit c4476c
Packit c4476c
=item B<other_policies>
Packit c4476c
Packit c4476c
Comma separated list of policies that are also acceptable by the TSA
Packit c4476c
and used only if the request explicitly specifies one of them. (Optional)
Packit c4476c
Packit c4476c
=item B<digests>
Packit c4476c
Packit c4476c
The list of message digest algorithms that the TSA accepts. At least
Packit c4476c
one algorithm must be specified. (Mandatory)
Packit c4476c
Packit c4476c
=item B<accuracy>
Packit c4476c
Packit c4476c
The accuracy of the time source of the TSA in seconds, milliseconds
Packit c4476c
and microseconds. E.g. secs:1, millisecs:500, microsecs:100. If any of
Packit c4476c
the components is missing zero is assumed for that field. (Optional)
Packit c4476c
Packit c4476c
=item B<clock_precision_digits>
Packit c4476c
Packit c4476c
Specifies the maximum number of digits, which represent the fraction of
Packit c4476c
seconds, that  need to be included in the time field. The trailing zeroes
Packit c4476c
must be removed from the time, so there might actually be fewer digits,
Packit c4476c
or no fraction of seconds at all. Supported only on UNIX platforms.
Packit c4476c
The maximum value is 6, default is 0.
Packit c4476c
(Optional)
Packit c4476c
Packit c4476c
=item B<ordering>
Packit c4476c
Packit c4476c
If this option is yes the responses generated by this TSA can always
Packit c4476c
be ordered, even if the time difference between two responses is less
Packit c4476c
than the sum of their accuracies. Default is no. (Optional)
Packit c4476c
Packit c4476c
=item B<tsa_name>
Packit c4476c
Packit c4476c
Set this option to yes if the subject name of the TSA must be included in
Packit c4476c
the TSA name field of the response. Default is no. (Optional)
Packit c4476c
Packit c4476c
=item B<ess_cert_id_chain>
Packit c4476c
Packit c4476c
The SignedData objects created by the TSA always contain the
Packit c4476c
certificate identifier of the signing certificate in a signed
Packit c4476c
attribute (see RFC 2634, Enhanced Security Services). If this option
Packit c4476c
is set to yes and either the B<certs> variable or the B<-chain> option
Packit c4476c
is specified then the certificate identifiers of the chain will also
Packit c4476c
be included in the SigningCertificate signed attribute. If this
Packit c4476c
variable is set to no, only the signing certificate identifier is
Packit c4476c
included. Default is no. (Optional)
Packit c4476c
Packit c4476c
=item B<ess_cert_id_alg>
Packit c4476c
Packit c4476c
This option specifies the hash function to be used to calculate the TSA's
Packit c4476c
public key certificate identifier. Default is sha256. (Optional)
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
=head1 EXAMPLES
Packit c4476c
Packit c4476c
All the examples below presume that B<OPENSSL_CONF> is set to a proper
Packit c4476c
configuration file, e.g. the example configuration file
Packit c4476c
openssl/apps/openssl.cnf will do.
Packit c4476c
Packit c4476c
=head2 Time Stamp Request
Packit c4476c
Packit c4476c
To create a time stamp request for design1.txt with SHA-256
Packit c4476c
without nonce and policy and no certificate is required in the response:
Packit c4476c
Packit c4476c
  openssl ts -query -data design1.txt -no_nonce \
Packit c4476c
        -out design1.tsq
Packit c4476c
Packit c4476c
To create a similar time stamp request with specifying the message imprint
Packit c4476c
explicitly:
Packit c4476c
Packit c4476c
  openssl ts -query -digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \
Packit c4476c
         -no_nonce -out design1.tsq
Packit c4476c
Packit c4476c
To print the content of the previous request in human readable format:
Packit c4476c
Packit c4476c
  openssl ts -query -in design1.tsq -text
Packit c4476c
Packit c4476c
To create a time stamp request which includes the SHA-512 digest
Packit c4476c
of design2.txt, requests the signer certificate and nonce,
Packit c4476c
specifies a policy id (assuming the tsa_policy1 name is defined in the
Packit c4476c
OID section of the config file):
Packit c4476c
Packit c4476c
  openssl ts -query -data design2.txt -sha512 \
Packit c4476c
        -tspolicy tsa_policy1 -cert -out design2.tsq
Packit c4476c
Packit c4476c
=head2 Time Stamp Response
Packit c4476c
Packit c4476c
Before generating a response a signing certificate must be created for
Packit c4476c
the TSA that contains the B<timeStamping> critical extended key usage extension
Packit c4476c
without any other key usage extensions. You can add this line to the
Packit c4476c
user certificate section of the config file to generate a proper certificate;
Packit c4476c
Packit c4476c
   extendedKeyUsage = critical,timeStamping
Packit c4476c
Packit c4476c
See L<req(1)>, L<ca(1)>, and L<x509(1)> for instructions. The examples
Packit c4476c
below assume that cacert.pem contains the certificate of the CA,
Packit c4476c
tsacert.pem is the signing certificate issued by cacert.pem and
Packit c4476c
tsakey.pem is the private key of the TSA.
Packit c4476c
Packit c4476c
To create a time stamp response for a request:
Packit c4476c
Packit c4476c
  openssl ts -reply -queryfile design1.tsq -inkey tsakey.pem \
Packit c4476c
        -signer tsacert.pem -out design1.tsr
Packit c4476c
Packit c4476c
If you want to use the settings in the config file you could just write:
Packit c4476c
Packit c4476c
  openssl ts -reply -queryfile design1.tsq -out design1.tsr
Packit c4476c
Packit c4476c
To print a time stamp reply to stdout in human readable format:
Packit c4476c
Packit c4476c
  openssl ts -reply -in design1.tsr -text
Packit c4476c
Packit c4476c
To create a time stamp token instead of time stamp response:
Packit c4476c
Packit c4476c
  openssl ts -reply -queryfile design1.tsq -out design1_token.der -token_out
Packit c4476c
Packit c4476c
To print a time stamp token to stdout in human readable format:
Packit c4476c
Packit c4476c
  openssl ts -reply -in design1_token.der -token_in -text -token_out
Packit c4476c
Packit c4476c
To extract the time stamp token from a response:
Packit c4476c
Packit c4476c
  openssl ts -reply -in design1.tsr -out design1_token.der -token_out
Packit c4476c
Packit c4476c
To add 'granted' status info to a time stamp token thereby creating a
Packit c4476c
valid response:
Packit c4476c
Packit c4476c
  openssl ts -reply -in design1_token.der -token_in -out design1.tsr
Packit c4476c
Packit c4476c
=head2 Time Stamp Verification
Packit c4476c
Packit c4476c
To verify a time stamp reply against a request:
Packit c4476c
Packit c4476c
  openssl ts -verify -queryfile design1.tsq -in design1.tsr \
Packit c4476c
        -CAfile cacert.pem -untrusted tsacert.pem
Packit c4476c
Packit c4476c
To verify a time stamp reply that includes the certificate chain:
Packit c4476c
Packit c4476c
  openssl ts -verify -queryfile design2.tsq -in design2.tsr \
Packit c4476c
        -CAfile cacert.pem
Packit c4476c
Packit c4476c
To verify a time stamp token against the original data file:
Packit c4476c
  openssl ts -verify -data design2.txt -in design2.tsr \
Packit c4476c
        -CAfile cacert.pem
Packit c4476c
Packit c4476c
To verify a time stamp token against a message imprint:
Packit c4476c
  openssl ts -verify -digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \
Packit c4476c
         -in design2.tsr -CAfile cacert.pem
Packit c4476c
Packit c4476c
You could also look at the 'test' directory for more examples.
Packit c4476c
Packit c4476c
=head1 BUGS
Packit c4476c
Packit c4476c
=for comment foreign manuals: procmail(1), perl(1)
Packit c4476c
Packit c4476c
=over 2
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
No support for time stamps over SMTP, though it is quite easy
Packit c4476c
to implement an automatic e-mail based TSA with L<procmail(1)>
Packit c4476c
and L<perl(1)>. HTTP server support is provided in the form of
Packit c4476c
a separate apache module. HTTP client support is provided by
Packit c4476c
L<tsget(1)>. Pure TCP/IP protocol is not supported.
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
The file containing the last serial number of the TSA is not
Packit c4476c
locked when being read or written. This is a problem if more than one
Packit c4476c
instance of L<openssl(1)> is trying to create a time stamp
Packit c4476c
response at the same time. This is not an issue when using the apache
Packit c4476c
server module, it does proper locking.
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
Look for the FIXME word in the source files.
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
The source code should really be reviewed by somebody else, too.
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
More testing is needed, I have done only some basic tests (see
Packit c4476c
test/testtsa).
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<tsget(1)>, L<openssl(1)>, L<req(1)>,
Packit c4476c
L<x509(1)>, L<ca(1)>, L<genrsa(1)>,
Packit c4476c
L<config(5)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2006-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut