Module mod_tsa

Summary

The mod_tsa module provides HTTP (and possibly HTTPS) interface for the Time Stamping Authority implemented by OpenSSL. The module can be accessed by sending a valid DER encoded RFC 3161-based time stamp request in an application/timestamp-query MIME message using PUT method. The response is an application/timestamp-reply MIME message containing the DER encoded time stamp response. If the request were processed successfully the response would also contain the time stamp token, the evidence for the existence of the related datum before the date indicated in the token. The status field of the response indicates if the request processing was successful.

When starting up mod_tsa writes information about the parsed configuration options into the Apache error log at NOTICE level. All invocations of the mod_tsa request handler are logged at DEBUG level. If a fatal error occurs during initialization Apache is stopped and the cause of error is logged at ERR log level.

The module also supports hardware accelerators and hardware security modules through the OpenSSL engine framework, look at the TSACryptoDevice directive.

Beside specifying the directives below, you must also assign the tsa request handler to a location, otherwise it will never be called. If you want your TSA to be accessible from anywhere at the http://your_server:your_port/tsa URL, you could write:

<Location /tsa>
    SetHandler tsa
    Order allow,deny
    Allow from all
</Location>

Sample configuration

The tsa.conf file included in the mod_tsa distribution contains a ready-to-use set up. The recommended way of setting up mod_tsa is to include the tsa.conf file from httpd.conf. You can do this by adding the following line to your Apache config file:

Include path_to_tsa_conf

You must also make sure that the LoadModule directive, which loads mod_tsa.so, appears before the above Include line in httpd.conf.

MySQL support

The module includes support for storing all the returned time stamp tokens in a MySQL table called token. The table has the following fields:

FieldValue
token_id The unique serial number of the token.
token_date The date and time of the token excluding the fraction of seconds.
token_pkcs7 The DER encoded PKCS7 time stamp token in binary format.

FireBird support

The module includes support for storing all the returned time stamp tokens in a FireBird database table called tsa_events. The table has the following fields:

FieldValue
token_id The unique serial number of the token.
token_date The date and time of the token excluding the fraction of seconds.
token_pkcs7 The DER encoded PKCS7 time stamp token in binary format.

PostgreSQL support

The module includes support for storing all the returned time stamp tokens in a PostgreSQL table called token. The table has the following fields:

FieldValue
token_id The unique serial number of the token.
token_date The date and time of the token excluding the fraction of seconds.
token_pkcs7 The DER encoded PKCS7 time stamp token in binary format (bytea).

Directives

TSASerialFile directive

Syntax: TSASerialFile filename
Default: <root>/conf/tsaserial
Context: server config
Status: mod_tsa

File for storing serial numbers for time stamp response generation. The file is updated every time a response is generated. If the file does not exist mod_tsa tries to create and initialise it with 0.

TSACryptoDevice directive

Syntax: TSACryptoDevice engine_id
Default: builtin
Context: server config
Status: mod_tsa

The identifier of the OpenSSL engine to use for cryptographic operations. The signing private key must be available on this engine. Any engine types supported by OpenSSL can be specified here, specify "builtin" for the default software engine.

TSACertificate directive

Syntax: TSACertificate filename
Default: <root>/conf/tsacert.pem
Context: server config
Status: mod_tsa

PEM-encoded certificate used by the TSA for signing responses. It must have timeStamping extended key usage.

TSACertificateChain directive

Syntax: TSACertificateChain filename
Default: empty chain
Context: server config
Status: mod_tsa

Collection of PEM-encoded certificates containing the certificate path for the TSA signing certificate excluding the TSA cert. The TSA certificate and these certificates are included in the SignedData if the time stamp query requests it.

TSAKey directive

Syntax: TSAKey filename
Default: <root>/conf/tsakey.pem
Context: server config
Status: mod_tsa

The private key of the TSA, it must match the public key of the TSA certificate. If the key file is protected by a pass phrase (highly recommended) the TSAKeyPassPhrase switch must be turned on.

TSAKeyPassPhrase directive

Syntax: TSAKeyPassPhrase On|Off
Default: Off
Context: server config
Status: mod_tsa

This switch specifies if the TSA private key is protected by a passphrase. If this switch is turned on a passphrase must be entered when Apache is being started.

TSADefaultPolicy directive

Syntax: TSADefaultPolicy OID
Default: none
Context: server config
Status: mod_tsa

The OID of the default TSA policy that is used in responses if the request does not specify any policy. You must explicitly specify an OID for this option.

TSAPolicies directive

Syntax: TSAPolicies OID1 OID2 ...
Default: empty list
Context: server config
Status: mod_tsa

List of TSA policy OIDs that are acceptable by the TSA in addition to the default policy. These are returned only if the client explicitly requests one of them.

TSAMessageDigests directive

Syntax: TSAMessageDigests MD1 MD2 ...
Default: sha1
Context: server config
Status: mod_tsa

List of message digests that the TSA accepts. The supported algorithms are: md2, md4, md5, sha, sha1, mdc2, ripemd160.

TSAAccuracy directive

Syntax: TSAAccuracy seconds milliseconds microseconds
Default: 0 0 0
Context: server config
Status: mod_tsa

Accuracy of the TSA time source in seconds, milliseconds and microseconds.

TSAClockPrecisionDigits directive

Syntax: TSAClockPrecisionDigits digits
Default: 0
Context: server config
Status: mod_tsa

Specifies the maximum number of digits, which represent the fraction of seconds, that need to be included in the time field. The trailing zeroes must be removed from the time, so there might actually be fewer digits, or no fraction of seconds at all. The maximum permitted value is 6.

TSAOrdering directive

Syntax: TSAOrdering On|Off
Default: Off
Context: server config
Status: mod_tsa

Specifies whether the ordering field should be set in time stamp responses.

TSAIncludeName directive

Syntax: TSAIncludeName On|Off
Default: Off
Context: server config
Status: mod_tsa

Specifies if the TSA name should be included in the responses. If this switched is turned on the subject name of the TSA certificate will be included in the time stamp response as the TSA name.

TSAESSCertIdChain directive

Syntax: TSAESSCertIdChain On|Off
Default: Off
Context: server config
Status: mod_tsa

Specifies if ESS certificate identifiers should be included for the certificate chain as well beside the signing certificate. The certificate identifier list is generated based on the certificates specified by TSACertificateChain. If this flag is turned off only the signing certificate identifier is included in the ESS SigningCertificate signed attribute.

TSADBModule directive

Syntax: TSADBModule None|MySQL|FireBird|PostgreSQL
Default: None
Context: server config
Status: mod_tsa

Specifies the module to be used for storing the time stamp tokens. If you specify None the tokens are not stored in a database.

TSAMySQLHost directive

Syntax: TSAMySQLHost server
Default: localhost
Context: server config
Status: mod_tsa

(Only if TSADBModule is MySQL) Specifies the IP address or DNS of the MySQL host used for storing the time stamp tokens.

TSAMySQLPort directive

Syntax: TSAMySQLPort port
Default: 3306
Context: server config
Status: mod_tsa

(Only if TSADBModule is MySQL) Specifies the TCP port on which MySQL is listening. Not used if server is localhost.

TSAMySQLUnixSocket directive

Syntax: TSAMySQLUnixSocket path
Default: /tmp/mysql.sock
Context: server config
Status: mod_tsa

(Only if TSADBModule is MySQL) Specifies the local UNIX domain socket on which MySQL is listening. Used only if MySQL is running on the localhost.

TSAMySQLUser directive

Syntax: TSAMySQLUser user
Default: tsa
Context: server config
Status: mod_tsa

(Only if TSADBModule is MySQL) The MySQL user name to be used for connecting to the database.

TSAMySQLDatabase directive

Syntax: TSAMySQLDatabase database
Default: tsa
Context: server config
Status: mod_tsa

(Only if TSADBModule is MySQL) Name of the MySQL database for storing the tokens.

TSAMySQLPassPhrase directive

Syntax: TSAMySQLPassPhrase On|Off
Default: Off
Context: server config
Status: mod_tsa

(Only if TSADBModule is MySQL) Specifies whether a password must be entered at startup for connecting to the MySQL database.

TSAFireBirdHost directive

Syntax: TSAFireBirdHost server
Default: localhost
Context: server config
Status: mod_tsa

(Only if TSADBModule is FireBird) Specifies the IP address or DNS of the FireBird host used for storing the time stamp tokens.

TSAFireBirdPort directive

Syntax: TSAFireBirdPort port
Default: 3306
Context: server config
Status: mod_tsa

(Only if TSADBModule is FireBird) Specifies the TCP port on which the FireBird server is listening. Not used if server is localhost.

TSAFireBirdUnixSocket directive

Syntax: TSAFireBirdUnixSocket path
Default: /tmp/firebird.sock
Context: server config
Status: mod_tsa

(Only if TSADBModule is FireBird) Specifies the local UNIX domain socket on which the FireBird server is listening. Used only if server is running on the localhost.

TSAFireBirdUser directive

Syntax: TSAFireBirdUser user
Default: SYSDBA
Context: server config
Status: mod_tsa

(Only if TSADBModule is FireBird) The FireBird user name to be used for connecting to the database.

TSAFireBirdDatabase directive

Syntax: TSAFireBirdDatabase database
Default: tsa
Context: server config
Status: mod_tsa

(Only if TSADBModule is FireBird) Name of the FireBird database for storing the tokens.

TSAFireBirdPassPhrase directive

Syntax: TSAFireBirdPassPhrase On|Off
Default: Off
Context: server config
Status: mod_tsa

(Only if TSADBModule is FireBird) Specifies whether a password must be entered at startup for connecting to the FireBird database.

TSAPostgreSQLHost directive

Syntax: TSAPostgreSQLHost server
Default: localhost
Context: server config
Status: mod_tsa

(Only if TSADBModule is PostgreSQL) Specifies the IP address or DNS of the PostgreSQL host used for storing the time stamp tokens.

TSAPostgreSQLPort directive

Syntax: TSAPostgreSQLPort port
Default: 5432
Context: server config
Status: mod_tsa

(Only if TSADBModule is PostgreSQL) Specifies the TCP port on which PostgreSQL is listening.

TSAPostgreSQLUser directive

Syntax: TSAPostgreSQLUser user
Default: tsa
Context: server config
Status: mod_tsa

(Only if TSADBModule is PostgreSQL) The PostgreSQL user name to be used for connecting to the database.

TSAPostgreSQLDatabase directive

Syntax: TSAPostgreSQLDatabase database
Default: tsa
Context: server config
Status: mod_tsa

(Only if TSADBModule is PostgreSQL) Name of the PostgreSQL database for storing the tokens.

TSAPostgreSQLPassPhrase directive

Syntax: TSAPostgreSQLPassPhrase On|Off
Default: Off
Context: server config
Status: mod_tsa

(Only if TSADBModule is PostgreSQL) Specifies whether a password must be entered at startup for connecting to the PostgreSQL database.


Zoltan Glozik
$Id: directives.html,v 1.8 2006/09/23 10:56:47 zglozik Exp $