PKISimple TSA Server User Manual
Install an RFC 3161 time stamp server on your own IIS web server, choose the key that signs the time stamps (a PFX file, the Windows certificate store, or an HSM, smart card or USB token through PKCS#11) and use it from Adobe Acrobat, Windows code signing, Java, PowerShell, OpenSSL and any other RFC 3161 client.
1. What is PKISimple TSA Server?
This is the user manual of PKISimple TSA Server 7.6. It explains how to install the server on your own IIS web server, how to choose the certificate that signs the time stamps, and how to use the server from Adobe Acrobat, Windows code signing, Java, PowerShell, OpenSSL and any other RFC 3161 client. The latest version of the manual is at https://tsaserver.com/manual/.
1.1 Time stamps in a few words
A time stamp proves that a piece of data existed at a given moment and that it has not been changed since. It is issued by a Time Stamping Authority (TSA): a service that receives the hash (the fingerprint) of the data, adds the current date and time, and signs the result with its own certificate. The signed result is the time stamp. The document itself never travels to the server, only its hash.
Time stamps are used with digital signatures. A signature stays verifiable after the signing certificate has expired, because the time stamp proves that the signature was made while the certificate was still valid.
1.2 What the server does
PKISimple TSA Server is a time stamping authority that runs as an application of Microsoft IIS, on most Windows web servers, so you do not need an extra machine. It keeps all its data in one SQLite database file in its own folder: no database server is needed.
The server answers, at the same address (get.aspx):
| Protocol | Used by |
|---|---|
| RFC 3161 (Time-Stamp Protocol), with the certificate identifier of RFC 5816 (ESSCertIDv2) | Adobe Acrobat, OpenSSL, Java, signtool /tr, signing libraries and most other programs |
| Authenticode time stamps (the older Microsoft format) | Windows code signing tools, for example signtool /t |
The time written in every time stamp is the UTC time of the machine on which the server runs (see Synchronize the clock of the server).
The product contains:
| Part | What it does |
|---|---|
The time stamp service (get.aspx) | The address that the client programs use. It receives the requests and returns the time stamps. Optionally it accepts only the users that you create (Users and authentication). |
| The administration pages | Configuration, the choice of the time stamp certificate, the users, the Audit Trail, the Time Stamp Responses, the Status page, Backup and Restore, and the registration (The main page and navigation). |
| Tools | Time Stamp a File, Verify a Time Stamp and Download the Time Stamp Certificate (Testing the server). |
| Three places for the key | The private key of the time stamp certificate can be in a PFX / P12 file, in the Windows certificate store, or on a hardware device (an HSM, a smart card, a USB token) that the server uses through PKCS#11 (The time stamp certificate, HSM, smart cards and USB tokens). |
| Key types | RSA, elliptic curves (ECDSA) and post-quantum ML-DSA certificates (ML-DSA time stamps follow RFC 9882). |
| Logs | An Audit Trail of the server events, protected by a hash chain (Audit Trail), and, optionally, a log of every time stamp response (Time Stamp Responses). |
| Status and backups | A Status page that checks everything that can stop the time stamps, with daily tests (Status page), and consistent backups of the database made while the server works (Backup, restore, move and upgrade). |
Two different certificates. A time stamp involves two certificates that must not be confused. The signer's certificate belongs to the person or the company that signs a document, a program or a script, and it stays with the client. The time stamp certificate belongs to the server: it signs the time stamps. This manual is about the second one. The people who verify a time stamp must trust the time stamp certificate (or the certification authority that issued it) in the same way as they trust any other certificate (Using the server with applications).
The certificate created at the installation. At its first start the server creates its own self-signed time stamp certificate, with a new key, and works with it at once. Nobody trusts it until its certificate is installed on their computer. It is meant for tests and for internal use; for a service that other people rely on, use a time stamp certificate issued by a certification authority that those people trust.
1.3 The two editions
| Licensed edition | Source Edition | |
|---|---|---|
| Package | TSAServer.zip | TSAServer-SourceEdition.zip, built from the source code |
| License agreement at the first start | Yes | No |
| Administrator login | Yes: the administration pages are protected by an administrator account | No: everybody who can open the pages can change the settings, the certificate and the users, and can read the logs |
| Trial period | 45 days or 5,000 time stamps, whichever comes first, until the server is registered (Trial period and registration) | None |
| Certificate created at the first start | CN=Local TSA Server | OU=OU, O=Org, CN=TSA Test do not use it in production |
Everything else (the time stamp service, the certificates, the users, the logs, backups) works in the same way. The chapters that apply only to the licensed edition say so, and the differences are marked with a Source Edition: note.
Source Edition: install it only where you trust everybody who can reach it (a test computer, a laboratory, an internal network that you control). Do not publish it on the internet.
1.4 Useful links
| What | Address |
|---|---|
| Product website | https://tsaserver.com/ |
| This manual | https://tsaserver.com/manual/ |
| Download | https://tsaserver.com/download/ |
| Pricing and licensing | https://tsaserver.com/pricing |
| Guides on deploying and operating a time stamping authority | https://tsaserver.com/guides |
| Contact (licensing or a specific setup) | https://tsaserver.com/contact |
| Public test server (RFC 3161) | https://ca.signfiles.com/tsa/ |
| Manual of Time Stamp Client | https://tsaserver.com/manual/time-stamp-client |
| Manual of Digital Certificate Tester | https://tsaserver.com/manual/digital-certificate-tester/ |
The folder Utils of the licensed package holds two programs for the computers of the clients (they are not needed on the server): Time Stamp Client, which requests and verifies time stamps, and Digital Certificate Tester, which checks certificates, smart cards and USB tokens. Each folder has a Manual.txt with the address of its manual.
| Program | What it does |
|---|---|
| Time Stamp Client | Requests time stamps from a server over the network, reports every detail of the answer (status, time, nonce, signature, certificate chain, revocation), verifies a time stamp against its file and can measure the throughput of a server (Testing the server). |
| Digital Certificate Tester | Checks that a certificate (Windows store, PFX file, HSM or token through PKCS#11) can really sign, shows where its key is and who can read it, and can run the test as another account, for example the account of the application pool (The time stamp certificate). |
Both programs also run on the server itself, which is where a key problem of the server must be checked.
2. Requirements and planning
2.1 Requirements
| Item | Requirement |
|---|---|
| Operating system | Windows 10 or Windows Server 2012 or later, with Internet Information Services (IIS). |
| .NET | Microsoft .NET Framework 4.8, and the ASP.NET 4.8 feature enabled in IIS (Installation on IIS). |
| Application pool | .NET CLR version v4.0 with the Integrated pipeline. The server runs in a 64-bit and in a 32-bit pool (it carries the SQLite engine for both). The bitness matters when you use a PKCS#11 library: the library must have the same bitness as the pool (HSM, smart cards and USB tokens). |
| Trust level | Full Trust. In partial trust (Medium Trust, on some shared web hostings) the signing keys and the PKCS#11 devices cannot be used. |
| Disk | A local disk for the application folder (not a network share): the database uses write-ahead logging (WAL), which does not work on network file systems. The account of the application pool must be able to write in the folder App_Data of the application (Files and folders). |
| Clock | Mandatory: the machine must be synchronized with an (S)NTP time server. The time stamps contain the UTC time of the machine; a wrong time on the machine means time stamps with a wrong time (Synchronize the clock of the server). |
| Certificate | Nothing at the start: the server creates its own self-signed certificate at the first start. For production, a time stamp certificate and its private key issued by a certification authority that your clients trust (The time stamp certificate). |
| Network | The client computers must reach the IIS site. Use HTTPS at least for the administration pages and for the clients that send a user name and a password. |
| Browser | A current web browser, for the administration pages. |
No database server is needed: the server keeps its data in one SQLite database file, App_Data\settings\tsa.db, created at the first start.
2.2 Disk space
Without the response log the database stays small (configuration, users, audit trail). With Log all responses turned on (Time Stamp Responses), every time stamp adds about 243 bytes to the database: about 230 MB for one million time stamps. Plan the disk for the number of time stamps you expect and for the retention period you choose, and add room for the backups made on the server (App_Data\backups): a backup is a full, compact copy of the database, and the server refuses to make one when the disk has less free space than the database.
The Status page warns when the free space on the disk of the data folder is under 1 GB or under twice the size of the database (Status page).
2.3 Decide before you install
| Question | Why it matters |
|---|---|
| Which address will the clients use? | The clients use https://your-server/alias/get.aspx (the main page shows it). Choose the web site, the host name and the alias (for example tsa) before you give the address to anybody: the address is written in the configuration of every client. |
| HTTP or HTTPS? | Over plain HTTP the administrator password, the passwords of the time stamp users and the login cookie travel readable. Use HTTPS whenever the server is reachable from other networks; you need a server (TLS) certificate for the IIS site, which is not the time stamp certificate (Security recommendations). |
| Which time stamp certificate? | The certificate created at the installation is self-signed: only the clients that install it trust it. For time stamps that other people verify, obtain a time stamp certificate from a certification authority they trust, or from the CA of your organization for internal use. |
| Where is the key of the certificate? | PFX file: the simplest choice; the key is stored, encrypted, in the database of the server. Windows certificate store: the certificate is installed in Windows (also when its key is managed by the CNG or CSP provider of a device); the account of the application pool must be able to use the key. PKCS#11: the key is in an HSM, a smart card or a USB token and never leaves it; the account of the pool must be able to use the library and the device. This choice has the most things to check (HSM, smart cards and USB tokens). |
| Which Windows account runs the application? | The server is not run by you: it runs in the IIS application pool, under the identity of the pool. Folder rights, certificate stores and hardware devices are checked for that account. This is the source of most installation problems. |
| Must the clients log in? | You can accept only the users that you create, each with a password and an optional maximum number of time stamps (Users and authentication). Check that your client programs can send a user name and a password (HTTP Basic authentication or in the address). |
| How will you back up the server? | Backups are made from the Backup and Restore page; there is no scheduler. Decide where the copies go (a separate disk or another machine), and keep the file secret.key safely apart: a backup cannot be restored without it (Backup, restore, move and upgrade). |
| Who may open the administration pages? | Licensed edition: the administrator account protects them; you may also limit them to the networks of the administrators. Source Edition: the pages have no login, so the whole site must be reachable only by people you trust. |
| Who does the first start? | Licensed edition: the first person who opens the pages accepts the license agreement and creates the administrator account, from any computer. Do it yourself, right after copying the files, before you give the address to anybody (Installation on IIS). |
Upgrading from 7.5 or earlier. Version 7.6 is a new installation: it does not read the data files of 7.5 or earlier (config.sys, users.sys, ...). Write down the settings and the users of the old server, and keep its certificate (PFX file, Windows store or device) available, to configure 7.6 again (Backup, restore, move and upgrade).
3. Installation on IIS
PKISimple TSA Server is installed as an application of an IIS web site. Use an account with Administrator rights for the steps below. The short version of these steps is in the file Installation.txt of the package.
3.1 Enable ASP.NET
On Windows 10 and Windows 11 open Control Panel → Programs and Features → Turn Windows features on or off. On Windows Server use Server Manager → Add Roles and Features and select the Web Server (IIS) role. Under Internet Information Services → World Wide Web Services → Application Development Features select ASP.NET 4.8. Windows selects the other components that it needs, such as .NET Extensibility 4.8.

3.2 Copy the files
The package (TSAServer.zip) contains:
| Item | Content |
|---|---|
TSAServer\ | The web application: the pages (*.aspx), Web.config, the folder bin and an empty folder App_Data. |
Installation.txt | The short installation instructions. |
Manual.txt | The address of this manual. |
License Agreement.txt, THIRD-PARTY-NOTICES.txt | The license terms. |
Utils\ | Two programs for the computers of the clients, not needed on the server (What is PKISimple TSA Server?). |
If Windows marks the downloaded zip file as blocked, right-click it, choose Properties and tick Unblock before you extract it; otherwise the database engine in bin\runtimes may not load.
Copy the content of the folder TSAServer to a folder of the server, for example C:\inetpub\TSAServer (next to the folder wwwroot of IIS, not in it), or a folder on a separate data disk, for example D:\TSAServer. Do not put it under the folder of another web application.
- The folder must be on a local disk, not a network share: the database uses write-ahead logging, which does not work on network file systems.
- Copy the whole
binfolder, includingbin\runtimes\win-x64andbin\runtimes\win-x86: they hold the SQLite engine (e_sqlite3.dll). Without it the database cannot be opened.
The package contains no data, no key and no certificate: the database, the key of the installation and the time stamp certificate are created at the first start (Files and folders).
3.3 Create the application pool
A dedicated pool keeps the account of the time stamp server separate from the other applications of the server, and it is the place where you decide which account runs the server.
- Open Internet Information Services (IIS) Manager and select Application Pools → Add Application Pool...
- Type a name, for example
TSAPool. Select .NET CLR version v4.0 and the Integrated managed pipeline mode. - Keep the default identity, ApplicationPoolIdentity, unless you have a reason to change it. The account has the name
IIS AppPool\TSAPool(the name of the pool, with the prefixIIS AppPool\). The identity can be changed later in Advanced Settings → Process Model → Identity.
The Application Pool Identity dialog (the button ... of Identity) offers a Built-in account (ApplicationPoolIdentity, NetworkService, LocalService or LocalSystem) or a Custom account, a Windows user with its password. Keep ApplicationPoolIdentity unless the certificate or the device must be used by a particular account; the accounts are compared in HSM, smart cards and USB tokens (section 09.5).

Write down the identity of the pool. The rights on the folder, the certificate stores and the hardware devices are checked for that account; most certificate selection problems are problems of this account (HSM, smart cards and USB tokens).
The setting Enable 32-Bit Applications of the pool decides whether the server runs as a 64-bit or a 32-bit process. Both work. It matters only for a PKCS#11 library, which must have the same bitness as the pool.
3.4 Add the application
In IIS Manager right-click the web site (for example Default Web Site) and select Add Application...
| Field | Value |
|---|---|
| Alias | tsa (the alias becomes part of the address) |
| Application pool | TSAPool (press Select... to choose it) |
| Physical path | C:\inetpub\TSAServer (the folder that contains Default.aspx and Web.config) |
The address of the server is then http://localhost/tsa/ on the server itself, or https://your-server/tsa/ from the network. The address that the clients use ends with get.aspx, for example https://your-server/tsa/get.aspx.

3.5 Give the application pool the rights it needs
The server writes in its own folder: the database, its backups and a few other files in App_Data, and the public certificate TSACertificate.crt in the application folder. The account of the application pool therefore needs the Modify right on the application folder. From a Command Prompt run as Administrator:
icacls "C:\inetpub\TSAServer" /grant "IIS AppPool\TSAPool:(OI)(CI)M"Use the account of your pool. For a custom identity use DOMAIN\user or COMPUTER\user. The rights are inherited by the files and folders that the server creates later.
If the folder is not writable, the pages show a red message that begins with "The application cannot write to its data folder" followed by the path of the folder. Give the account of the pool the Modify right and reload the page. Remote visitors see only "The server has a configuration problem. The details are shown when this page is opened on the server itself (http://localhost/...), and in the Audit Trail."
3.6 IIS authentication and HTTPS
In IIS Manager select the application, then Authentication:
- Anonymous Authentication must be Enabled. The time stamp users (Users and authentication) and the administrator are checked by the server itself, not by IIS.
- Basic Authentication must be Disabled, and Windows Authentication too. If IIS asks for a Windows account, the clients cannot send the user name and the password that the server expects.
Use HTTPS. Add an HTTPS binding to the web site with a server (TLS) certificate. Over plain HTTP the administrator password, the login cookie and the passwords of the time stamp users travel readable; the login page then warns "This connection is not encrypted (HTTP): the password is sent in clear text. Use HTTPS when the server can be reached from other networks." Over HTTPS the login cookie is marked Secure. See Security recommendations.
3.7 First start
Open the address of the application in a browser on the server itself, for example http://localhost/tsa/.
- License agreement. The first page shows the license agreement. Scroll to its end, tick I have read the license agreement and I accept its terms and press Accept and Continue (the box can be ticked only after the agreement was scrolled to its end). Until the agreement is accepted and the administrator account is created, the server refuses every time stamp request with "The server is not installed yet: its administrator must open the administration pages, accept the license agreement and create the administrator account."
- Administrator account. The page Create an administrator account asks for a Username and a Password; press Create Account. Until the account exists, anyone who opens the page can create it: do it yourself, right away, before you give the address to anybody (License agreement and administrator account).
- Time stamp certificate. When the account is created, the server creates its own time stamp certificate with a new key (
CN=Local TSA Server, self-signed, RSA 3072, signed with SHA-384, valid 5 years) and works with it at once. - Test. Open Configuration and press Issue a Test Time Stamp. The server issues a time stamp with the saved settings and verifies it: "The test time stamp was issued and verified. Time (UTC): …". Compare the time with a reliable source of UTC time.

Until the administrator account exists, the first person who opens the pages creates it, from any computer. Complete the first start yourself, right after copying the files, before you give the address to anybody.
The clients trust the time stamps only when they trust the time stamp certificate: give them the file of Download the Time Stamp Certificate (main page, Tools), or select or create the certificate of your organization on the Configuration page (The time stamp certificate). Then continue with the Quick start.
If you get an error page instead of the first page, check:
- that the ASP.NET 4.8 feature is installed (03.1);
- that the application pool uses .NET CLR version v4.0 and the Integrated pipeline;
- that the physical path of the application is the folder that contains
Default.aspxandWeb.config; - that the folder
bin\runtimeswas copied: if the database cannot be opened, the pages say "The database cannot be opened: …" and the details are written toApp_Data\settings\startup-error.txt(Problems and solutions).
Before you use the server, make sure that the clock of the machine is synchronized with an (S)NTP time server (Synchronize the clock of the server). The server takes the time of the time stamps from the machine.
Source Edition: there is no license agreement and no administrator account. At the first start the server creates its certificate at once, with the subject OU=OU, O=Org, CN=TSA Test do not use it in production; open http://localhost/tsa/ and press Issue a Test Time Stamp on the Configuration page. The administration pages have no login: everybody who can open them can change the settings, the certificate and the users, and can read the logs. Install the Source Edition only where you trust everybody who can reach it, and do not publish it on the internet.
3.8 Shared web hosting
The server can also run at a hosting provider that offers ASP.NET 4.8 on IIS. Web.config is written for that: it has no sections that hosting providers usually lock, and the data files are in App_Data, which IIS and ASP.NET never serve, even where the rules of Web.config are ignored. Check with the provider that:
- the site runs in Full Trust. In partial trust the pages show "The application runs in partial trust (Medium Trust): the signing keys and the PKCS#11 devices cannot be used. Ask the hosting provider to run the site in Full Trust.";
- the account of the site can write in the folder
App_Dataand in the application folder; - the files are on a local disk of the web server, not on a network share.
Upload the content of the folder TSAServer with the whole bin folder, then open the site and continue as in 03.7. If something fails at the start, App_Data\settings\startup-error.txt (readable with the file manager or FTP of the provider) holds the reason.
PKCS#11 devices and the Windows certificate store of the machine are usually not available at a hosting provider: use a PFX file. Keep the RSA key of the certificate created at the installation, or use an RSA PFX: on some shared hostings an ECDSA key of a PFX file cannot be loaded, and the main page then says "The time stamp certificate cannot be used: The system cannot find the file specified".
You cannot set the clock of a shared server. Ask the provider whether its servers are synchronized with an (S)NTP time server, and compare the time of a test time stamp with a source of UTC time that you trust (Synchronize the clock of the server).
3.9 Updating a 7.6 installation
To install a newer build of 7.6 over an installation that works: make a backup first (Backup, restore, move and upgrade), stop the application pool, copy the new files over the old ones and start the pool again. Never delete or replace the folder App_Data: it holds the data of the server, including the key of its time stamp certificate and the file secret.key.
When you upload the new files with FTP, do not use a "mirror" or "synchronize" mode that deletes on the server the files that are not on your computer: it would delete App_Data and the data of the server.
Version 7.6 does not read the data files of 7.5 or earlier (config.sys, users.sys, ...): an upgrade from those versions is a new installation, configured again.
4. Synchronize the clock of the server
The time of the time stamps is the time of this computer. PKISimple TSA Server has no clock of its own. It writes in every time stamp the UTC time of the machine on which it runs. If the time of the machine is not correct, the time stamps are issued with the wrong time, and nothing in them shows it: they look valid. A time stamp that was issued with a wrong time stays wrong; it cannot be corrected afterwards.
The person who installs the server must make sure that the machine is synchronized with an (S)NTP time server, before the server is used and for as long as it runs. The server reads the clock of Windows at the moment of each response, so the synchronization is not a setting of the server: it is a task of the computer, and a mandatory step of the installation.
4.1 How to synchronize the machine
- The server is a member of an Active Directory domain. A member of the domain takes its time from the domain controllers, through the Windows Time service. Make sure that the domain itself is synchronized with a reliable time source, and check that the service works (below).
- The server is not in a domain. Set an (S)NTP time server for the Windows Time service. In a Command Prompt run as Administrator:
Command Prompt
w32tm /config /manualpeerlist:"time.windows.com" /syncfromflags:manual /update w32tm /resyncUse the time server that your organization prescribes, if there is one.
- A synchronization application. You can also use an application that does the synchronization for you. Time Sync Tool (https://timesynctool.com) is available free of charge: it keeps the clock of the computer synchronized with (S)NTP time servers and shows the state of the synchronization.

Open the port of the (S)NTP connection. The synchronization uses UDP port 123: it must be open between the server and the time server (check the firewall of the server and the firewall of the network).
4.2 Check the synchronization
w32tm /query /statusshows the state of the Windows Time service. Look at Source and Last Successful Sync Time. Leap Indicator: 3(not synchronized) means that the clock is not synchronized.- The service Windows Time (w32time) must be running. In PowerShell:
Get-Service w32time. - Select the correct time zone of the computer too. The time stamps use UTC, and Windows computes UTC from the local time and the time zone when the time is set by hand.
- A quick check with the server itself: on the Configuration page press Issue a Test Time Stamp. The message shows the time written in the test time stamp: "The test time stamp was issued and verified. Time (UTC): …". The Status page shows the time of the server too, under Clock. Compare it with the real UTC time from a source that you trust.
Check the synchronization again after every restart of the machine and after every change of the network or of the firewall, and keep an eye on it while the server runs: a clock that stopped synchronizing drifts slowly, and nobody notices.
4.3 If the clock cannot be trusted: the external clock monitor
If you monitor the clock (with a script or with a tool of your own), you can tell the server to stop issuing time stamps while the clock is wrong. The server watches for the file:
App_Data\settings\invalidtime.sysWhile this file exists:
- every time stamp request is refused. An RFC 3161 client receives a rejection with the failure information timeNotAvailable (the TSA's time source is not available) and the text "TSA time is desynchronized."; an Authenticode client receives HTTP 503 with the same text;
- the main page and the Status page (Clock, as an error) show "The clock is marked as desynchronized (App_Data\settings\invalidtime.sys exists): the server refuses every time stamp request until the file is deleted.";
- each refusal is written to the Audit Trail and counted as a rejected request.
The content of the file does not matter, only its presence. The server checks it at most once per second, so it follows your monitor within a second. When the clock is correct again, your tool deletes the file and the server works again. The server itself never creates or deletes this file.
The account that runs your monitor needs the right to create and delete files in App_Data\settings.
4.4 Accuracy
The option Set Accuracy of the Configuration page (Server settings) writes in the time stamps the accuracy that you guarantee (seconds, milliseconds, microseconds). Set only a value that the synchronization of your machine really guarantees.
5. The main page and navigation
The main page of PKISimple TSA Server shows the state of the server at a glance and leads to every other page. This chapter describes the main page and the elements that every administration page shares: the menu bar, the bottom bar, the saving rules and the log tables.
Open the administration pages at the address of the application, for example http://localhost/tsa/ on the server itself or https://tsa.example.com/tsa/ from another computer. The licensed edition first asks you to log in (chapter 7); after the login the main page opens.
Source Edition: there is no login. The administration pages open directly, and anybody who can reach them can change the server.
5.1 The main page

The page has a title bar Main Page and, from top to bottom: the messages that need attention (only when there is something to report), Status Info, Server Settings and Tools.
Messages at the top
These messages appear only when they apply. Each one tells what to do.
| Message | Colour | Meaning |
|---|---|---|
| Problems of the hosting environment (for example the folder rights or the trust level) | Red | The server cannot work correctly in this IIS configuration. See chapter 3 and chapter 22. |
| "The clock is marked as desynchronized (App_Data\settings\invalidtime.sys exists): the server refuses every time stamp request until the file is deleted." | Red | An external clock monitor marked the clock as wrong (chapter 4). |
| "The time stamp certificate cannot be used: …" | Yellow | The certificate or its private key cannot be loaded; the reason follows. Every request is refused until this is fixed (chapter 8). |
| "The time stamp certificate is expired or not yet valid (valid until …): the server refuses every time stamp request. Select or create another certificate." | Yellow | The certificate is outside its validity period. |
| "The time stamp certificate expires on …. Select or create another certificate before that date." | Yellow | Less than 30 days of validity are left. |
| "The configuration is not valid: … The server refuses every time stamp request. Correct the accuracy on the Configuration page and save." | Yellow | The accuracy stored in the configuration cannot be written in a time stamp (chapter 10). |
| "The time stamp certificate was created by the server at the installation (…)" | Blue | A note, not a problem: see 05.2. |
| The status warning, ending with See the Status page | Red or yellow | See below. |
The status warning sums up what the Status page found (chapter 14). It can contain:
- "Errors now: …" — the errors of the Status page at this moment (for example the license, the certificate, the clock, the database);
- "The tests of … found problems: …" or "… found warnings: …" — the result of the last daily tests, when it was not good;
- "The daily tests have not run yet." — an hour after the start of the application, no daily test has run;
- "The last daily tests are from …: they have not run since (is the application pool running?)." — the daily tests stopped.
The warning is red when there is an error, yellow when there are only warnings. When everything is well, nothing is shown.
Status Info
| Item | What it shows |
|---|---|
| License Status | On a registered server: "Licensed to customer" and the link Change the license. During the trial: "Trial version" (or "Trial version, ended" in red), with a yellow box "PKISimple TSA Server is not registered.", the days and time stamps left, and the buttons Register Now and Buy a license. See chapter 18. |
| Version | The version of the server. |
| Time Stamp Address | The address that the client programs use, always ending with get.aspx. See below. |
| Number of time stamps issued | Every time stamp granted, RFC 3161 or Authenticode, including the test time stamps of the administration pages. |
| Number of requests rejected | The requests that received no time stamp: malformed requests, a refused option (hash algorithm, policy, extension), wrong credentials or a user over its maximum, a clock problem, a certificate problem. The reason of each refusal is in the Audit Trail (chapter 12). |
The Time Stamp Address is built from the address you used to open the page. If you opened the page as http://localhost/tsa/, it shows http://localhost/tsa/get.aspx, which works only on the server itself: give the clients the address with the real name of the server (and https:// when they connect from other networks). Clicking the address opens it in a new tab; the browser shows the short text "PKISimple TSA Server: RFC 3161 and Authenticode time stamp server", which confirms that the application answers. The clients themselves send their requests with HTTP POST (chapter 16).
The two counters are kept in the file App_Data\settings\certengine.sys (chapter 20).
Server Settings
Links to the pages of the server: Configuration (chapter 10), Audit Trail (chapter 12), Time Stamp Responses (chapter 13), Status (chapter 14) and Backup and Restore (chapter 19).
Tools
| Link | What it does |
|---|---|
| Time Stamp a File | Time stamps a file that you select, with the current settings (chapter 15). |
| Verify a Time Stamp | Shows and checks a time stamp response file, optionally against the original file (chapter 15). |
| Download the Time Stamp Certificate | Downloads the public certificate of the server (TSACertificate.crt, DER format) in a new tab. Give it to the clients that must trust the server (chapter 16). |
The same three links are in the Tools menu of the menu bar.
5.2 The certificate created at the installation
When the administrator account is created (chapter 7), the server creates its own time stamp certificate and starts signing with it at once:
- subject CN=Local TSA Server, self-signed;
- RSA 3072 key, signed with SHA-384, valid 5 years;
- key usage Digital Signature and extended key usage Time Stamping, both critical.
Every installation creates its own key; no key is shipped with the product.
While this certificate is in use, the main page shows a blue note: "The time stamp certificate was created by the server at the installation (CN=Local TSA Server, self-signed, RSA 3072, signed with SHA-384, valid until …). The time stamps are valid for the clients that trust this certificate (Tools: Download the Time Stamp Certificate). To use the certificate of your organization, select or create it on the Configuration page."
The certificate is fully usable: the time stamps are valid for every client that trusts it. To use a certificate issued by a certification authority, or one with the name of your organization, select or create it on the Configuration page (chapter 8, chapter 9). The note disappears as soon as another certificate is in use.
Source Edition: the certificate is created at the first start (there is no administrator account) with the subject OU=OU, O=Org, CN=TSA Test do not use it in production, the same key and extensions. Replace it before any real use.
5.3 The menu bar
Every administration page has the same dark bar at the top:
| Item | Opens |
|---|---|
| PKISimple TSA Server (the name, on the left) | The main page. |
| Main | The main page (also underlined on the Registration page). |
| Configuration | The Configuration page (also underlined on Select Certificate, Create Certificate and Users). |
| Audit Trail | The Audit Trail. |
| Responses | The Time Stamp Responses page. |
| Status | The Status page. |
| Backup | The Backup and Restore page. |
| Tools | A menu with Time Stamp a File, Verify a Time Stamp and Download the Time Stamp Certificate. |
| Log out (on the right) | Ends the login (chapter 7). |
The current page is underlined. On a phone or a narrow window, the links move to a second row under the name.
Source Edition: there is no Log out.
5.4 The bottom bar
Every page ends with the same bar:
- on the left, the way back: ← Main Page, or ← Configuration on the pages that are opened from the Configuration page (Select Certificate, Create Certificate and Users);
- on the right, the actions of the page, the main one (blue) last, for example Restore Defaults and Save Configuration on the Configuration page.
Buttons that belong to one section of a page (for example a search, a load or a test) are small and stay under their fields, not in the bottom bar.
5.5 Saving and unsaved changes
- A setting changes only when you click its Save button: Save Configuration on the Configuration page, Save of the response log on the Time Stamp Responses page, Add User or Save Changes on the Users page. No check box saves by itself.
- After a successful save, the page shows a confirmation at the top (for example "The configuration was saved."). Reloading the page does not save again.
- If you leave a page with changes that are not saved — through a link, the menu bar, or by closing the tab — the browser asks first whether you want to leave. The question is the browser's own dialog; its text depends on the browser. The question also comes after a failed save, because the changes are still not saved.
- When a message appears after an action and the page is scrolled, the page brings the message into view.
5.6 Log tables
The Audit Trail and the Time Stamp Responses page show their entries in tables with the same navigation:
- newest entries first, 25 rows per page by default; 50 or 100 can be chosen in Rows;
- above and below the table: the range shown (for example "1–25 of 1,851"), First, ‹ Previous, "Page 1 of 75", Next › and Last.
Each page reads only its own rows from the database, so every entry of a large log can be reached. See chapter 12 and chapter 13 for the searches and filters.
6. Quick start
The shortest path from a new installation of PKISimple TSA Server to a first time stamp that you have verified. Each step links to the chapter with the details.
6.1 Before you start
- Install the server on IIS and open the application once on the server itself, for example
http://localhost/tsa/(chapter 3). - Synchronize the clock of the machine with an (S)NTP time server. The server writes the time of the machine in every time stamp (chapter 4).
6.2 Accept the license agreement and create the administrator account
- The first page is the license agreement. Scroll to its end, tick I have read the license agreement and I accept its terms and click Accept and Continue. Until then the server refuses every time stamp request.
- The page then asks for the administrator account: type a user name and a password and click Create Account. Do this right away: until the account exists, anybody who opens the page can create it.
- Log in with the new account. The server has already created its time stamp certificate (CN=Local TSA Server), and the main page shows a blue note about it.
Details: chapter 7.
Source Edition: there is no license agreement and no login. Open http://localhost/tsa/: the main page appears directly, and the certificate (OU=OU, O=Org, CN=TSA Test do not use it in production) is created at the first start.
6.3 Issue a test time stamp
Open Configuration in the menu bar and click Issue a Test Time Stamp. The server issues a time stamp inside itself, with the saved settings, and verifies it. The page shows:
The test time stamp was issued and verified. Time (UTC): …If it shows "Time stamping test error: …" instead, read the reason and see chapter 22. Do not go on until the test succeeds.
This test does not go through the network. The test of 06.6 does.
6.4 Choose the certificate (optional)
The certificate created at the installation is self-signed. It works, but each client must install it as trusted. To sign with a certificate issued by a certification authority, or with the name of your organization, use Select the Digital Certificate or Create New Certificate on the Configuration page (chapter 8; for an HSM, smart card or USB token, chapter 9). Then click Issue a Test Time Stamp again.
6.5 Review the settings and the users (optional)
- The defaults of the Configuration page suit most clients. Change them only for a reason (a policy OID of your organization, a required nonce, the certificate chain in the responses…), then click Save Configuration (chapter 10).
- If only known clients may obtain time stamps, create the users first (Configuration → Manage Users), then tick Require authentication and save (chapter 11).
6.6 Request and verify a time stamp from a client
Copy the Time Stamp Address from the main page; it ends with get.aspx. Use the name of the server that the clients will use, not localhost (chapter 5).
From another computer with OpenSSL and curl (replace the address and the file name):
openssl ts -query -data document.pdf -sha256 -cert -out request.tsq
curl -H "Content-Type: application/timestamp-query" --data-binary @request.tsq https://tsa.example.com/tsa/get.aspx -o response.tsr
openssl ts -reply -in response.tsr -textThe last command must show Status: Granted. and the time of the time stamp (UTC). If authentication is required, add -u user:password to the curl command.
To verify the time stamp, download the certificate of the server (Tools → Download the Time Stamp Certificate, file TSACertificate.crt, DER format), convert it to PEM and verify:
openssl x509 -inform der -in TSACertificate.crt -out tsa.pem
openssl ts -verify -data document.pdf -in response.tsr -CAfile tsa.pemOpenSSL writes Verification: OK. For a certificate issued by a certification authority, the file given to -CAfile must contain the certificates of the authority instead (or as well).
You can also check the response on the server with Tools → Verify a Time Stamp (chapter 15).
6.7 Give the address to the clients
Configure the client programs with the time stamp address, and make the certificate of the server trusted where it is needed (chapter 16, chapter 17).
6.8 After the first time stamp
- Register the server before the trial period ends: 45 days or 5,000 time stamps, whichever comes first (chapter 18). The Source Edition has no trial.
- Back up the server and keep
App_Data\settings\secret.keywith the backups (chapter 19). - Check the Status page from time to time, or whenever the main page shows a status warning (chapter 14).
- Read the security recommendations before you open the server to other networks (chapter 21).
7. License agreement and the administrator account
The administration pages of PKISimple TSA Server are protected by one administrator account. This chapter describes the first start (the license agreement and the creation of the account), the login, the end of a session and the reset of a forgotten password.
All the pages of the server ask for the login, except the time stamp address itself (get.aspx, used by the clients) and the public certificate (TSACertificate.crt).
Source Edition: this chapter does not apply. The Source Edition shows no license agreement and has no administrator account, no login and no Log out: everybody who can open its pages can change its settings, its certificate and its users, and read its logs. Install it only where you trust everybody who can reach it, never on the internet.
7.1 The license agreement
A new installation first shows the License Agreement of the server.
- Read the agreement in its box and scroll to its end. The check box can be ticked only after that; the line under it changes from "Scroll to the end of the agreement to accept it." to "You have reached the end of the agreement."
- Tick I have read the license agreement and I accept its terms.
- Click Accept and Continue (it works only with the box ticked; the server checks the box too).
The page then says "The license agreement was accepted. Create the administrator account: the server then creates its time stamp certificate."
Until the agreement is accepted and the administrator account is created, the server creates no certificate and refuses every time stamp request with "The server is not installed yet: its administrator must open the administration pages, accept the license agreement and create the administrator account."
The acceptance is recorded with its time, the IP address and the SHA-256 hash of the text of the agreement, and is written to the Audit Trail as License agreement accepted (chapter 12). A restore of a backup keeps it (chapter 19).
7.2 The administrator account

After the agreement, the page shows Create an administrator account: "Create the administrator account. Until it exists, anyone who opens this page can create it."
- Type a Username and a Password.
- Click Create Account.
Create the account immediately after the installation, before you give the address of the server to anybody.
Rules and messages:
| Message | Cause |
|---|---|
| "The user name is required." | The user name is empty. |
| "The user name cannot contain spaces." | The user name has a space (spaces before and after it are removed). |
| "The password is required." | The password is empty. |
| "The administrator account already exists." | Somebody else created the account first. |
The server keeps only one administrator account. It stores the user name and a hash of the password, never the password itself. The server does not impose a minimum length: choose a long password that is not used anywhere else.
When the account is created, the server creates its time stamp certificate (CN=Local TSA Server, see chapter 5) and saves its first configuration, so it can issue time stamps as soon as you log in. The creation is written to the Audit Trail.
7.3 Logging in

The login page (Log in, "Log in to manage the server.") asks for the Username and the Password. Click Log in; the main page opens.
| Message | Cause |
|---|---|
| "Invalid credentials. Forgot the password? On the server, create an empty file named reset-admin.txt in App_Data\settings and reload this page: it asks for the code that the server writes into that file." | Wrong user name or password. See 07.5. |
| "Too many failed attempts. Try again in N seconds." | Too many wrong passwords (see below). |
| "This connection is not encrypted (HTTP): the password is sent in clear text. Use HTTPS when the server can be reached from other networks." | A warning shown above the form when the page is opened with http://. The login works, but use HTTPS from other networks (chapter 21). |
| "The server has a configuration problem. The details are shown when this page is opened on the server itself (http://localhost/...), and in the Audit Trail." | The server has a problem of the hosting environment. Open the page on the server itself to see the details. |
Wrong passwords. The first five wrong passwords are answered at once. After that, for the same IP address or the same user name, each new attempt must wait one second for each failure above five, at most 30 seconds, after the last failure; an attempt made earlier is refused without checking the password. The count is cleared by a successful login, or after 15 minutes without failures.
Every login, failed login and logout is written to the Audit Trail (Login, Logout).
7.4 Sessions and Log out
- A login is valid for at most 8 hours, and ends after 30 minutes without activity on the pages. Then the login page appears again.
- Log out (on the right of the menu bar) ends the session. A logout ends every login session issued before it, also in other browsers and in the other worker processes of the application.
- Creating or resetting the administrator account and restoring a backup also end every session.
- The login is kept in a cookie (
TSAAuth_…). The cookie cannot be read by scripts, is never sent on requests started by another site, and is bound to this installation and to the address you used: a login made athttp://localhost/tsa/is not valid athttps://tsa.example.com/tsa/. - When you log in over HTTPS, the browser sends the cookie only over HTTPS. The cookie is not restricted to HTTPS otherwise, so that a server without HTTPS can still be managed: use HTTPS when the administration pages can be reached from other networks.
The administrator password for sensitive actions. Some actions ask for the administrator password again, even during a session: downloading a backup, restoring a backup and deleting old entries of the Audit Trail (chapter 12, chapter 19). A wrong password there is written to the Audit Trail and counts like a wrong login.
7.5 Forgotten password
If you forget the administrator password, reset the account from the server itself. Only somebody who can write in the folder of the application can do it; IIS never serves the App_Data folder.
- On the server, create an empty file named
reset-admin.txtinApp_Data\settings(for exampleC:\inetpub\TSAServer\App_Data\settings\reset-admin.txt). - Open (or reload) the login page. It shows Reset the administrator account, and the server writes a one-time code into the file, for example:
Text
PKISimple TSA Server - reset of the administrator account Code: ABCD-EFGH Created (UTC): 2026-11-30 10:15:00
- On the login page, type the Code from the file, a New username, the New password and Confirm the new password, then click Reset the Account.
The previous account is replaced, every login session ends, and the file is deleted. The page says "The administrator account was reset. Log in with the new user name and password." The reset is written to the Audit Trail (Administrator account reset).
| Message | Cause |
|---|---|
| "Wrong code. Type the code written in the file reset-admin.txt on the server." | The code is wrong. Wrong codes are written to the Audit Trail (Failed account reset). |
| "Wrong code. After 5 wrong codes a new code was written in the file: open it again." | After five wrong codes the server writes a new code. |
| "The code in the file had expired: a new code was written in the file. Open it again." | A code is valid for one hour. |
| "Too many wrong codes. Try again in N seconds." | Repeated wrong codes are slowed down like wrong logins. |
| "The two passwords are different." | New password and Confirm the new password differ. |
| "The administrator account was reset, but the file reset-admin.txt cannot be deleted: delete it on the server, then log in." | The account was reset, but the application pool cannot delete the file. |
The code has eight characters, shown as two groups of four; the dash, spaces and lower case do not matter when you type it. To cancel a reset, delete the file and reload the login page.
8. The time stamp certificate
Every time stamp that PKISimple TSA Server issues is signed with the private key of its time stamp certificate. The clients check that signature with the public certificate. Without a certificate that can sign, the server refuses every request. This chapter explains what the certificate must look like, how to create one, how to select one, how to test it, and how to renew it.
The certificate is managed in the Time Stamp Certificate area at the top of the Configuration page. The area shows the certificate in use (location, subject, serial number, thumbprint, validity, key and signature, private key) and the buttons Select the Digital Certificate, Create New Certificate and Issue a Test Time Stamp.

Most problems are about the private key, not about the certificate. A certificate can look perfect and still fail to sign: the account of the application pool cannot open its key in the Windows store, the key was imported into the wrong store, or a device cannot be reached from a service. Sections 08.6.2 and 08.11 explain how to get this right the first time, and chapter 09 does the same for HSMs and tokens.
8.1 What a time stamp certificate must look like
A time stamp certificate is a special certificate. You cannot use an SSL/TLS certificate, a code signing certificate or a certificate for signing documents. The server checks the rules of RFC 3161 (section 2.3) when you select or create a certificate. It checks them again each time it loads the certificate for signing.
| The certificate must... | Message when it does not |
|---|---|
| have an Extended Key Usage extension | The certificate has no Extended Key Usage extension (it must contain only Time Stamping, marked as critical). |
| have the Extended Key Usage extension marked as critical | The Extended Key Usage extension must be marked as critical. |
| have only one purpose in that extension: Time Stamping (1.3.6.1.5.5.7.3.8) | The Extended Key Usage extension must contain only Time Stamping (1.3.6.1.5.5.7.3.8). |
| have a Key Usage extension with Digital Signature | The Key Usage extension must contain Digital Signature. |
| have an RSA key of 2048 bits or more | The RSA key must have at least 2048 bits. |
| or an ECDSA key of 256 bits or more | The ECDSA key must have at least 256 bits (named curve P-256 or larger). |
| or an ML-DSA key (ML-DSA-44, ML-DSA-65 or ML-DSA-87) | The key must be RSA (at least 2048 bits), ECDSA (at least 256 bits) or ML-DSA (ML-DSA-44, ML-DSA-65 or ML-DSA-87). |
| be inside its validity period | The certificate is expired (valid until ... UTC). / The certificate is not yet valid (valid from ... UTC). |
When a certificate fails, the selection page shows The selected certificate cannot be used for time stamping: followed by every problem found, and the button Set as Current Time Stamp Certificate stays disabled.
When you order a time stamp certificate from a certification authority, ask for:
- an RSA key of 3072 bits or more, or an ECDSA key on a named curve (P-256, P-384 or P-521), and a signature of the certificate with SHA-256 or stronger;
- Key Usage: Digital Signature, marked critical;
- Extended Key Usage: Time Stamping only, marked critical;
- a validity of one year or more. Plan the renewal before it expires (section 08.10).
The validity is checked on every request. A certificate that has expired, or is not yet valid, signs nothing: the server refuses every request until you select another certificate. The main page and the Configuration page warn you 30 days before the expiry.
Revocation is not checked. The server does not check CRLs or OCSP when you select a certificate.
8.2 The certificate created at the installation
A new installation does not wait for you to bring a certificate. When the administrator account is created (see License agreement and the administrator account), the server creates its own time stamp certificate and signs with it at once:
| Property | Value |
|---|---|
| Subject | CN=Local TSA Server |
| Issuer | the certificate itself (self-signed) |
| Key | RSA 3072 bits, new for each installation (no key is shipped with the product) |
| Signature of the certificate | SHA-384 with RSA |
| Validity | 5 years |
| Key Usage | Digital Signature, critical |
| Extended Key Usage | Time Stamping, critical |
The key is kept in a PFX file in the database of the server, protected by a random password that nobody needs to type. The audit trail records the creation ("TSA certificate created").
While this certificate is in use, the main page shows a blue note:
"The time stamp certificate was created by the server at the installation (CN=Local TSA Server, self-signed, RSA 3072, signed with SHA-384, valid until ...). The time stamps are valid for the clients that trust this certificate (Tools: Download the Time Stamp Certificate). To use the certificate of your organization, select or create it on the Configuration page."
The note disappears when you select or create another certificate. The certificate is fine for tests and for internal use, provided the clients trust it (section 08.9). For a service that other organizations rely on, use a certificate issued by a certification authority, or at least one with the name of your organization.
Source Edition: the Source Edition creates the same certificate (same key type, signature, validity and extensions) with the subject OU=OU, O=Org, CN=TSA Test do not use it in production. It is created at the first start, because this edition has no administrator account. Replace it before any real use.
8.3 RSA or ECDSA?
The certificate created at the installation uses RSA because RSA works everywhere:
- Windows keeps the ECDSA key of a PFX file with CNG. Some servers (for example a shared web hosting) allow neither an ephemeral key nor a CNG key. On such a server an ECDSA certificate cannot be loaded, and the main page says "The time stamp certificate cannot be used: The system cannot find the file specified". An RSA key is loaded with CryptoAPI there.
- Some old clients do not accept ECDSA time stamps.
ECDSA is much faster. On your own server, an ECDSA P-256 certificate issues about 5 to 7 times as many time stamps per second as RSA 3072. If the server must handle a high load and your clients accept ECDSA, create or order an ECDSA certificate.
The size of the RSA key matters too. ETSI TS 119 312 (the cryptographic suites of the European trust services) does not allow new certificates with RSA keys below 3000 bits after 2026-12-31, and a certificate with such a key issued until then must expire no later than 2028-12-31. The Create Certificate page still creates RSA 2048 certificates, but it warns you (section 08.5). Prefer RSA 3072 or more.
An ECDSA key in a PFX file must use a named curve (for example P-256). If the curve is given with explicit parameters, Windows cannot import the private key, and the server says:
"The ECDSA key of the certificate uses explicit curve parameters instead of a named curve (RFC 5480 requires a named curve, for example P-256). Windows cannot import such a private key, so the certificate cannot be used from a PFX file or from the Windows store. Generate the certificate again with a named curve."
8.4 Post-quantum certificates (ML-DSA)
The server can sign time stamps with ML-DSA (FIPS 204), a signature algorithm designed to resist quantum computers. The time stamps follow RFC 9882 (ML-DSA in CMS): they are always hashed with SHA-512 and identify the certificate with ESSCertIDv2. The options Time Stamp Response Hash Algorithm and Use the legacy ESSCertID attribute (SHA-1) of the Configuration page do not apply to an ML-DSA certificate; the page says so under the hash algorithm. Their values stay saved and apply again when you go back to an RSA or ECDSA certificate (see Server settings).
Choosing an ML-DSA certificate is the only switch: there is no separate option. Before you choose one, know the consequences:
- Not every client verifies ML-DSA time stamps yet. At the time of writing, OpenSSL 3.5 (
openssl cms -verify) and Bouncy Castle verify them, and so does the Verify a Time Stamp page of the server. Most signing and PDF tools do not, andopenssl ts -verifydoes not either. Windows (signtool, Authenticode) cannot verify them. The Authenticode responses of the server are signed with ML-DSA too. - The responses are larger: a time stamp with an ML-DSA-65 certificate included is about 9.4 KB.
- Where the key can be: in a PFX file, or in the Windows certificate store (Windows signs with it through CNG). The Windows store needs a version of Windows with ML-DSA in CNG: Windows 11 24H2 or later with the updates of 2025, or Windows Server 2025. An ML-DSA key cannot be used on a PKCS#11 device; the server refuses it with: "Post-quantum (ML-DSA) keys can be used from a PFX file or from the Windows certificate store, not from a PKCS #11 device. Select the certificate as a PFX file or in the Windows certificate store."
Use an ML-DSA certificate where the clients are known to support it, for example for long-term archiving. Do not use it as the only time stamp of documents that must be verified today by common software.
When an ML-DSA certificate is selected or created, the message stays green and adds the note: "The certificate has a post-quantum ML-DSA key: some time stamp clients may not accept its time stamps yet."
8.5 Create a certificate with the server
The server can create a self-signed time stamp certificate, kept in a PFX file. On the Configuration page click Create New Certificate. The Create Certificate page opens.

| Field | Meaning |
|---|---|
| TSA Server Name (CN=) * | The name of the certificate, for example the name of your service. Required. |
| Organization Name (O=) | Optional. |
| Organization Unit (OU=) | Optional. |
| E-mail Address (E=) | Optional. Must be a valid e-mail address. |
| Country Code (C=) | Optional. Two letters (ISO 3166-1), for example RO. |
| Validity period | A number and a unit: Days, Months or Years. Default: 5 Years. |
| Key algorithm | RSA (default), Elliptic Curves or ML-DSA (post-quantum). |
| Key size / curve | RSA: 2048, 3072 (default) or 4096 bits. Elliptic Curves: named curve P-256 (default), P-384 or P-521. ML-DSA: parameter set (FIPS 204) ML-DSA-44, ML-DSA-65 (default) or ML-DSA-87. |
| Certificate signature hash | The hash used to sign the certificate: SHA256 (default), SHA384 or SHA512. Disabled for ML-DSA, which signs without a separate hash. |
| PFX password * | Protects the PFX file that holds the certificate and its private key. At least 10 characters. Required. |
| Set as current time stamp certificate | Checked by default. The new certificate is used to sign the time stamp responses at once. |
Click Generate Certificate. The certificate is self-signed and has the extensions of a time stamp certificate: Key Usage Digital Signature and Extended Key Usage Time Stamping, both critical.
The PFX password. The password alone protects the private key in the downloaded PFX file. Use 16 or more random characters, and keep the password apart from the file, for example in a password manager. You need it to use the file elsewhere, or to select it again on this server.
After the certificate is created, the page shows a message and the Download Certificate button:

| Message | Meaning |
|---|---|
| The time stamping certificate was created. | Done. |
| The time stamping certificate was created. Warning: ETSI TS 119 312 does not allow new certificates with RSA keys below 3000 bits after 2026-12-31. Use 3072 bits or more, or an elliptic curve. | An RSA 2048 key, created after 2026-12-31. The certificate works, but the European standards do not accept it. |
| The time stamping certificate was created. Warning: ETSI TS 119 312 requires a certificate with an RSA key below 3000 bits to end no later than 2028-12-31. Use 3072 bits or more, or an elliptic curve, or a shorter validity. | An RSA 2048 key that is valid after 2028-12-31. |
| The time stamping certificate was created. The certificate has a post-quantum ML-DSA key: some time stamp clients may not accept its time stamps yet. | An ML-DSA certificate (section 08.4). |
| The TSA Server Name is required. | Type a name in TSA Server Name (CN=). |
| The validity period is not valid. | Type a whole number greater than 0. |
| The PFX password is required. / The PFX password must have at least 10 characters. | Type a longer password. |
| The country code must be two letters (ISO 3166-1), for example RO. | Correct the country code, or leave it empty. |
| The e-mail address is not valid. | Correct the address, or leave it empty. |
Download Certificate saves the PFX file (TSAServerCertificate.pfx) with the certificate and its private key. Keep the file and its password in a safe place.
- When Set as current time stamp certificate is checked, the certificate becomes the certificate of the server at once. The public certificate is published for the clients (section 08.9), and the audit trail records the change ("TSA certificate created").
- When it is not checked, the certificate is created only for download (the audit trail records this too). The server keeps it for one hour. After that, Download Certificate answers "The certificate is no longer available for download. Create it again."
A self-signed certificate. Programs that verify your time stamps report the certificate as not trusted until it is installed as trusted on their computer (section 08.9). Do not use it for a service that other organizations rely on.
8.6 Select a certificate
Click Select the Digital Certificate on the Configuration page to use a certificate that you already have. The Digital Certificate page opens.

The page has two parts:
- Current certificate, at the top: the certificate in use. It does not change while you examine other certificates.
- Choose a new certificate: the source of the new certificate, and the certificate that you load or pick. That one appears under the choices as Selected certificate, with the note "Not in use until you click Set as Current Time Stamp Certificate."
Processor architecture (helps determine the correct device driver): shows "(x64) 64-bit process" or "(x86) 32-bit process": whether the application pool runs the server as a 64-bit or a 32-bit process. You need it to choose a PKCS#11 library (HSM, smart cards and USB tokens).
There are three sources:
- Load certificate from a .PFX or .P12 file (section 08.6.1);
- Load certificate from the Windows certificate store (section 08.6.2);
- Load certificate using PKCS#11 driver, for an HSM, a smart card or a USB token (chapter 09).
When you load or pick a certificate, the server checks the rules of section 08.1. For a PFX file or the Windows store, it also signs a test message with the private key. A certificate can therefore pass the rules and still be refused:
"The selected certificate has the extensions of a time stamping certificate, but the server cannot sign with its private key: ..."
When everything works, the page says "The selected certificate can be used for time stamping." and enables Set as Current Time Stamp Certificate. Click it to use the certificate. The page answers "The time stamping certificate was set.", the selected certificate moves to Current certificate, and the audit trail records "TSA certificate changed" with the subject, serial number and thumbprint. The next time stamp request is signed with the new certificate. Then go back to the Configuration page and click Issue a Test Time Stamp (see Testing the server).
If the change cannot be saved, the page shows "The time stamping certificate cannot be set:" followed by the reason.
8.6.1 A PFX or P12 file
- Select Load certificate from a .PFX or .P12 file.
- In Certificate file, choose the file. Type the Certificate password.
- Click Load Certificate. The page shows the certificate under Selected certificate and whether it can be used.
- Click Set as Current Time Stamp Certificate.
- If the file cannot be read, the page shows "The PFX file cannot be used:" followed by the reason (usually a wrong password). Without a file, it says "Select the PFX file."
- The server keeps a copy of the PFX file in its database, encrypted, and the password in encrypted form. Back up the file
secret.keytogether with the database: the copies cannot be read without it (see Backup, restore, move and upgrade). An upload that is not set as current is deleted after an hour. - The server opens the key in memory when Windows allows it, so no key file is written on the disk of the server. Only if that fails does it use the machine or the user key store of the account.
- When Include whole chain on the Time Stamp Response is checked (see Server settings), the chain is taken from the PFX file. Only the certificates of the chain of the time stamp certificate are used; other certificates in the file are left out.
8.6.2 The Windows certificate store
Use this source when the certificate is installed in Windows. This includes certificates whose keys are managed by the CNG or CryptoAPI provider of a device. (For HSMs and tokens, compare it with PKCS#11 in section 09.2.)
- Select Load certificate from the Windows certificate store.
- Choose the Certificate store: Current User or Local Machine (explained below).
- Choose the certificate in Certificates on store. The list starts with "Choose a certificate (N in this store)…". Each entry shows the subject and the expiry date. A certificate whose extensions or dates do not meet the rules is marked "— not usable for time stamping".
- The page shows the certificate, tests its private key and says whether it can be used.
- Click Set as Current Time Stamp Certificate.
The server saves only the store and the thumbprint of the certificate, not the certificate. If the certificate is removed from the store later, the selection page says "The time stamping certificate is not in the Windows certificate store any more. Select a certificate."
Other messages of this source:
| Message | Meaning |
|---|---|
| No certificates were found in this certificate store. | The Personal store of that location is empty for the account of the server. |
| The certificate store cannot be opened: ... The account that runs the server (...) must be allowed to read the certificate store. | The account of the application pool cannot open the store. |
When Include whole chain on the Time Stamp Response is checked, the chain is built by Windows from the certificate stores of the server: install the intermediate certificates there.
The server runs as the account of the application pool. Every operation with the certificate (opening the store, reading the key file, loading the provider) is done by the identity of the IIS application pool, for example IIS AppPool\TSAPool, not by the administrator who installed the certificate. Whenever it works for you but not in IIS, these two accounts are not the same.
Current User or Local Machine?
Current User is the store of the account that runs the application pool. It is not your store, and it is not the store of the person who installed the certificate. Local Machine belongs to the computer and is the same for every account.
| The certificate was installed... | What the server sees |
|---|---|
| by you, logged on with your own account, in Current User | Nothing. The certificate is in your profile. The server sees it only if the application pool runs under your account. |
in the Personal store of Local Computer (certlm.msc) | The certificate, in Local Machine, for any account. The account of the application pool must also have the right to read its private key (below). |
| by the account of the application pool itself | The certificate, in Current User. |
Our advice: use Local Machine. The result does not depend on which account installed the certificate. Then give the account of the application pool the right to read the private key.
Install a certificate for the server, step by step
- Copy the PFX file to the server. Press Windows+R, type
certlm.mscand press Enter (the store of the computer; it asks for administrator rights). - Right-click Personal → All Tasks → Import.... Select the PFX file, type its password and place the certificate in Personal. Do not enable strong private key protection: a service cannot answer its confirmation window. Marking the key as exportable is not needed.
- Open Personal → Certificates, right-click the certificate → All Tasks → Manage Private Keys....
- Press Add..., then Locations... and select the local computer (the account of the pool does not exist in the domain). Type
IIS AppPool\TSAPool(with the name of your pool), press Check Names and OK. For a pool that runs as Network Service, typeNETWORK SERVICE. - Allow Read only (Full control is not needed) and press OK.
- In the server: Select the Digital Certificate → Load certificate from the Windows certificate store → Local Machine → pick the certificate. The page must say that the certificate can be used. Click Set as Current Time Stamp Certificate, then Issue a Test Time Stamp on the Configuration page.
Give the application pool the right to use the private key
The key of a certificate in the Local Machine store is a file with its own permissions. The account of the application pool must be allowed to read it.
- With the Certificates snap-in. Manage Private Keys..., as in steps 3 to 5 above.
- With PowerShell (for Server Core, scripts, or when Manage Private Keys is not available), run as Administrator:
PowerShell
# 1. import into the Personal store of the computer $pfxPassword = Read-Host "PFX password" -AsSecureString $cert = Import-PfxCertificate -FilePath C:\Install\tsa.pfx -CertStoreLocation Cert:\LocalMachine\My -Password $pfxPassword # 2. find the file of the private key (CNG keys: Crypto\Keys, CryptoAPI keys: Crypto\RSA\MachineKeys) $name = ((certutil -store my $cert.Thumbprint) | Select-String 'Unique container name: (.+)').Matches[0].Groups[1].Value.Trim() $file = Get-ChildItem 'C:\ProgramData\Microsoft\Crypto\Keys', 'C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys' -Filter $name -ErrorAction SilentlyContinue | Select-Object -First 1 # 3. give the account of the pool the right to read it icacls $file.FullName /grant "IIS AppPool\TSAPool:R"
- From the command line. In a Command Prompt run as Administrator,
certutil -store my <thumbprint>shows the line "Unique container name": the name of the key file. The key files of the computer are inC:\ProgramData\Microsoft\Crypto\Keys(CNG keys) andC:\ProgramData\Microsoft\Crypto\RSA\MachineKeys(CryptoAPI keys). Give the account the right to read that file:Command Prompticacls "C:\ProgramData\Microsoft\Crypto\Keys\<unique container name>" /grant "IIS AppPool\TSAPool:R"
The key of a certificate in the Current User store is in the profile of that user, for example C:\Users\<user>\AppData\Roaming\Microsoft\Crypto\Keys.
When the private key cannot be used
The server explains the errors of Windows first, then gives the original text and code of Windows, so you can search for them. A certificate whose key cannot be used cannot be set as current.

| The message starts with... | Cause and solution |
|---|---|
| The private key of the certificate was not found. The certificate is installed without its private key: install it again together with the key. | Only the public part was imported. Import the PFX file, with its key. |
| The server cannot open the private key of the certificate. The key file does not exist for the account that runs the server (...), or that account has no right to read it ... | Windows reports both cases as "Keyset does not exist" or "Invalid provider type specified". Check that the certificate was installed with its key in the store that you selected, and give the account the right to read the key (above). |
| The account that runs the server (...) is not allowed to use the private key of the certificate. ... | Access denied. Give the account the right to read the key. |
| The private key cannot be used in its present state. ... | Usually no access to the key, or a key that needs a person to use it. |
| The private key needs a person to answer (a PIN or a confirmation window), and a service cannot do that. ... | The key is protected with a PIN window or a confirmation. A service cannot answer it. Use a key without confirmation, or a PKCS#11 device (chapter 09). |
| The server cannot find the file of the private key for the account that runs it (...). ... | The key file was deleted, or another account installed the certificate. Install the certificate again together with its key. |
| The private key '...' (machine key of '...') cannot be opened: ... Under IIS, the application pool identity needs read access to the private key of the certificate. | The same problem for an ECDSA key. |
| The private key of the certificate does not exist: the certificate refers to a key without a name of '...'. ... | Windows did not save the ECDSA key of a PFX file whose key has no friendly name. Install the certificate again from a PFX file whose key has a friendly name, or select the PFX file itself. |
| This version of Windows cannot use ML-DSA keys (post-quantum): ... | An ML-DSA certificate in the store of a Windows version without ML-DSA (section 08.4). |
The command certutil -user -store my <thumbprint> (or certutil -store my <thumbprint> for Local Machine) shows the state of the key for the account that runs the command. That is your account, not the account of the server. A good result of certutil does not prove that the server can use the key. The proof is the test made by the server itself: the selection, Test the Certificate and Issue a Test Time Stamp.
8.7 Test the certificate
The Test the Certificate button of each source signs a test message with the private key and saves nothing:
| Source | What it tests |
|---|---|
| PFX file | The file loaded on the page; if no file is loaded, the current certificate when it is a PFX file. Otherwise: "Load a PFX file first: the current certificate is not a PFX file." |
| Windows certificate store | The certificate chosen in the list. Without a choice: "Choose a certificate first." |
| PKCS#11 | See chapter 09. Without a .CER file, it tests the current PKCS#11 certificate. |
Use it, for example, after a token or an HSM was reconnected, or after you changed the rights on a key. The result starts with "Signing test passed." or "Signing test failed:".
Issue a Test Time Stamp on the Configuration page goes further: it issues a complete time stamp inside the server with the saved settings and verifies it ("The test time stamp was issued and verified. Time (UTC): ..."). If it fails, the message starts with "Time stamping test error:" and gives the reason. See Testing the server.
What the clients see. When the server cannot sign, an RFC 3161 client receives a rejection (systemFailure) with the text "TSA Response error." instead of a time stamp. The reason is recorded in the audit trail ("Refused time stamp request", "Time stamp error: ..."); see Audit Trail. When the certificate cannot be loaded at all, the main page, the Configuration page and the Status page show the reason.
8.8 Messages about the certificate
The selection page adds notes and warnings to the success message:
| Message | Colour | Meaning |
|---|---|---|
| The certificate is self-signed: clients must install it as trusted to validate its time stamps. | green (a note) | A self-signed certificate. It works; give the clients the public certificate (section 08.9). Suitable for internal use. |
| The certificate has a post-quantum ML-DSA key: some time stamp clients may not accept its time stamps yet. | green (a note) | See section 08.4. |
| The chain of the certificate cannot be built up to a trusted root on this server: ... Install the intermediate and root certificates, or the clients may not be able to verify the time stamps. | yellow (a warning) | An intermediate or root certificate is missing on the server. The certificate can still be set. |
The chain is not checked for a self-signed or an ML-DSA certificate.
The main page and the Configuration page also show warnings about the certificate in use:
| Message | Meaning |
|---|---|
| The time stamp certificate expires on .... Select or create another certificate before that date. | Less than 30 days left. |
| The time stamp certificate is expired or not yet valid (valid until ...): the server refuses every time stamp request. Select or create another certificate. | The server issues no time stamps. |
| The time stamp certificate cannot be used: ... | The certificate cannot be loaded (for example a Windows store certificate that was removed, or a key that the account cannot open). On the Configuration page the message ends with "Select or create the time stamping certificate." |
The Time stamp certificate line of the Status page shows the same state (see Status).
8.9 The public certificate for the clients
The clients need the public certificate of the server to validate its time stamps. For a self-signed certificate, they must install it as trusted; for a certificate issued by a certification authority, they need the chain up to a root that they trust.
Each time the certificate changes, the server writes its public part to the file TSACertificate.crt in the application folder. You can get it:
- from Tools → Download the Time Stamp Certificate (the menu bar or the Tools section of the main page);
- at the address of the application, for example
http://your-server/tsa/TSACertificate.crt.
The file holds only the public certificate, never the private key. How to install it as trusted on the computers of the clients is described in Using the server with applications.
8.10 Renew the certificate before it expires
A certificate that has expired signs nothing, so plan the renewal:
- Note the expiry date (the Valid from line of the certificate, the Status page). The server warns you 30 days before the expiry, on the main page, the Configuration page and the Status page.
- Before that date, get the new certificate: order it from the certification authority (with the same extensions, section 08.1), or create it on the Create Certificate page.
- Select it and click Set as Current Time Stamp Certificate (or keep Set as current time stamp certificate checked when you create it), then click Issue a Test Time Stamp.
- Give the new public certificate (and its chain, if it changed) to the clients.
Keep the old public certificate. The clients may need it to validate the time stamps issued before the change.
For a key on a PKCS#11 device, see the notes on renewal in chapter 09.
A certificate that signs from a PFX file is in the backups of the server. A certificate of the Windows store or of a PKCS#11 device is not: the backup holds only the reference to it. See Backup, restore, move and upgrade.
8.11 Tips for the private key
- Recycle the pool after a change. After you change the identity of the pool, the rights on a key or a setting of a provider, recycle the application pool, wait 20 to 30 seconds and test again.
- A renewed certificate has a new key file. The Read right is given to one key file. After every renewal or re-import, give the right again on the new key, then select the new certificate.
- Give the right to the pool, not to everybody. Avoid Everyone, Users or the whole IIS_IUSRS group: every other application of the server would be able to sign with your key.
- The certificate is in your Current User store and the key is not exportable. You cannot move the key. Import the original PFX file again into Local Machine, or run the pool under the account that owns the certificate (a custom identity with Load User Profile set to True, see section 09.5).
- A hardware key in your Current User store (a smart card, a token, an HSM with a CSP or KSP): make the certificate available in Local Machine without copying the key, with
certutil -addstoreandcertutil -repairstore(section 09.5). - Strong private key protection. A key imported with strong protection asks for a confirmation, and a service cannot answer it: the server says "The private key needs a person to answer ...". Import the key again without strong protection.
- A 32-bit pool and the provider of a device. When Enable 32-Bit Applications is True, the CSP or KSP of the device must exist in a 32-bit version too.
- The certificate is not in the list at all. The account of the pool does not see that store. Do not go on: the server cannot use a certificate that it cannot see. Use Local Machine, or the account that owns the store.
- Diagnose with a known account. Set the identity of the pool to LocalSystem for a minute and test again. If it works now, the problem is the rights of the normal account: give it the missing right and set the identity back.
8.12 Test the key with Digital Certificate Tester
Digital Certificate Tester (folder Utils of the package) signs with a certificate in the same way as the server, without changing anything on the computer:
- certificates of the Windows store (CSP and KSP keys, also of tokens and HSMs), PFX files and PKCS#11 libraries;
- it signs with SHA-256, SHA-384 and SHA-512 and verifies every signature;
- it shows where the key is (provider, container, key file and who can read it);
- it can run the test as another account, for example the account of the application pool;
- it explains errors such as "Keyset does not exist", "Access is denied" or a wrong PIN, and shows how many PIN attempts a token has left.
Run it on the server, not on your desktop. If it works for you but the server fails, run it as the account of the pool and give that account the right it lacks. Its manual is at https://tsaserver.com/manual/digital-certificate-tester/.
9. HSM, smart cards and USB tokens (PKCS#11)
PKISimple TSA Server can keep its time stamp key in a hardware security module (HSM), a smart card or a USB token. The private key never leaves the device: the device makes the signatures. Most installations get stuck at the step where they select such a certificate. The cause is almost always an account, a right or a permission, not the server itself. This chapter explains how the server uses the device and what to check, in the order in which the problems usually appear.
9.1 How the server uses the device
- The server uses the PKCS#11 library of the manufacturer of the device (a
.dllfile installed on the server). The library is loaded inside the IIS worker process of the application pool and runs under the account of the pool. - On the first request, the server loads the library, opens a session with the device, logs in as the normal user with the PIN that you saved, and finds the private key of the certificate. It keeps the sessions open for the next requests.
- For each time stamp, the server computes the hash and sends it to the device, which returns the signature. The document of the client never reaches the device, and the private key never reaches the server.
- The server uses the mechanism
CKM_RSA_PKCSfor RSA keys andCKM_ECDSAfor ECDSA keys. Only RSA and ECDSA keys are supported; an ML-DSA key cannot be used from a device (see The time stamp certificate). The device must allow these mechanisms, and it must let the normal user sign without any further approval for each operation. - Parallel sessions. The server makes at most as many signatures at the same time as the setting Parallel sessions, each in its own session. Use 1 for smart cards and USB tokens, which sign one operation at a time anyway, and 4 to 64 for network HSMs, which sign in parallel. The speed of the service depends on the speed of the device.
- The first signature of each session is checked with the public key of the certificate. A device that signs with another key is detected before a client receives a time stamp that no verifier would accept.
- A lost device does not need a restart. If the device is removed and connected again, or a session is lost, the server loads the library again once and repeats the signature.
- The certificate placed in the time stamps comes from the public certificate (the
.cerfile) that you give to the server, not from the device. The server also uses this certificate to find the device that holds the key, and the private key itself.
9.2 PKCS#11 or the Windows certificate store?
A hardware device can be used in two ways. For an HSM, choose PKCS#11.
| PKCS#11 | Windows certificate store | |
|---|---|---|
| Who talks to the device | The server, directly, through the PKCS#11 library. | Windows, through the CNG or CryptoAPI provider that the device installs. |
| The PIN | You type it once; the server saves it (encrypted) and logs in by itself. | The provider asks for it. A service cannot answer a PIN window, so the device must be set to work without one. |
| Which Windows account created or owns the certificate | Does not matter. The certificate is a .cer file. | Matters a lot (Current User store), or you must use Local Machine and give rights on the key. |
| Bitness | The PKCS#11 library must have the bitness of the application pool. | The CNG or CryptoAPI provider of the device must exist in the bitness of the application pool. |
| Use it for | HSMs, and devices with a PKCS#11 library that can run in a service. | Devices that put their certificates and keys in Windows and have no PKCS#11 library. |
The Windows store is described in section 08.6.2.
Smart cards and USB tokens. They are made for a person who types a PIN in a window. Their software (the middleware) does not always work in a service, without a screen. We cannot guarantee that every token works with the server. With a PKCS#11 library that works in a service, the server types the PIN itself, and a token can be used. Test it as described below.
What was tested. The PKCS#11 support of version 7.6 was tested with SoftHSM2, a software token, not with a hardware HSM or smart card. If you want to practise the procedure of this chapter before you connect the real device, SoftHSM2 can play the role of the device on a test server.
9.3 Before you start
- The certificate is on the device, and it is a time stamp certificate (see section 08.1). If the key pair is generated on the device (the request, the CSR, is created with the tools of the device), the certification authority must issue the certificate with Time Stamping as the only extended key usage, marked critical. The certificate that the authority returns is then installed on the device.
- The device allows signing without user intervention. For an HSM, the partition must be activated, and the normal user must be able to sign with the PIN or password alone: without a PED, without an administrator PIN, and without any other PIN mechanism for each operation. A network HSM must have the server registered (authorized) as a client of the partition. The administrator of the HSM does this once for each server.
- The software of the device is installed on the server (the HSM client, or the middleware of the token), in the version that the manufacturer prescribes for your Windows version. Check it with the tool of the manufacturer: the device, the partition and the certificate must be visible.
- You know the bitness of the application pool. The Digital Certificate page shows it on the line Processor architecture (helps determine the correct device driver): "(x64) 64-bit process" or "(x86) 32-bit process". A 64-bit pool needs the 64-bit library. A 32-bit pool (Enable 32-Bit Applications set to True in the advanced settings of the pool) needs the 32-bit library.
- You have the public certificate in a
.cerfile. Export it with the tool of the manufacturer, ask the certification authority for it, or export it from the Windows store (certmgr.msc) if the middleware copies the certificate there. Export only the public part (No, do not export the private key). - You know the account of the application pool, and you have read section 09.5.
9.4 Step by step
- On the Configuration page click Select the Digital Certificate, and select Load certificate using PKCS#11 driver. The PKCS#11 Configuration area opens.
- Fill in the fields:
Field What to type PKCS#11 driver path The full path of the library on the server, with the drive letter, on a local disk. For example C:\Program Files\SafeNet\LunaClient\cryptoki.dll(an HSM client) orC:\Windows\System32\eTPKCS11.dll(a token middleware). A network path, a relative path or a file that is not a.dllis refused.Slot number A whole number, 0 for the first device. It is the position in the list of the slots that have a device present, starting from 0. It is not the slot ID that the tools of the manufacturer show. The server also looks for the certificate in the other slots, so a wrong number matters only when no slot shows the certificate (section 09.6). Device User PIN The PIN or the password of the normal user of the device. The server saves it, encrypted, in its database and uses it to log in. The box hides what you type. Leave it empty to keep the saved PIN of the same driver and slot. Parallel sessions How many signatures the device makes at the same time: 1 for smart cards and USB tokens, 4 to 64 for network HSMs. Default: 1. Public certificate (.CER) The file of the certificate, exactly as it is on the device. After a renewal, select the new file.
- Click Test the Certificate. The server loads the library, finds the device that holds the certificate, logs in with the PIN, finds the private key, signs a test message with SHA-256 and checks the signature with the public key of the certificate. It also checks the rules of a time stamp certificate. When everything works, the page says "Signing test passed. The PKCS#11 device works and holds the private key of the selected certificate." and enables Set as Current Time Stamp Certificate.
- Click Set as Current Time Stamp Certificate. The page answers "The time stamping certificate was set." The public certificate and the encrypted PIN are saved in the database.
- Go to the Configuration page and click Issue a Test Time Stamp. This test asks the server itself for a complete time stamp and verifies it. It must report "The test time stamp was issued and verified."

Test the device that is in use. Click Test the Certificate without selecting a .cer file. The server then tests the current PKCS#11 certificate on the same driver and slot (with the typed PIN, or the saved one if the box is empty): "Signing test passed. The PKCS#11 device works and holds the private key of the current certificate." Use it, for example, after the HSM was reconnected. Nothing is saved.
The server does not repeat a rejected PIN. Each wrong PIN uses up one of the attempts that the device allows, and the device locks after a few. For this reason, after the device rejects the PIN, the server does not send it again. It sends the PIN again only when the PKCS#11 settings are changed, when you run a test (Test the Certificate in the PKCS#11 area, or Issue a Test Time Stamp on the Configuration page), or after the application restarts. If the PIN was wrong, correct it first, then test once.

Include whole chain. When Include whole chain on the Time Stamp Response is checked (see Server settings), the chain of a PKCS#11 certificate is built by Windows from the certificate stores of the server. Install the intermediate certificates on the server.
9.5 Users, rights and permissions
The most important rule
The server runs as the account of the application pool, not as you. Everything that the server does with the device is done by the account of the application pool: it loads the library, reads the configuration of the device software, looks in the certificate store and opens the key file. It is not done by you, nor by the account that installed the device software, nor by the account that created the certificate. When "it works for me but not in IIS", the cause is almost always that these two accounts are not the same.
Find the account of the application pool
In IIS Manager select Application Pools, select the pool of the server, and open Advanced Settings... → Process Model → Identity. The Task Manager (Details tab, column User name, process w3wp.exe) shows the account of the running process; for the default identity it shows the name of the pool.
| Identity of the pool | Name to use in permissions | What to know |
|---|---|---|
| ApplicationPoolIdentity (default) | IIS AppPool\<pool name>, for example IIS AppPool\TSAPool | Each pool has its own account, with only the rights that you give to it by name. It has its own, empty, Current User certificate store. |
| NetworkService | NT AUTHORITY\NETWORK SERVICE | A Windows account shared by several services. |
| LocalSystem | NT AUTHORITY\SYSTEM | Very wide rights on the computer. It solves most rights problems at once, so it is useful for a diagnosis (below). It is not a good permanent choice. |
| Custom account | DOMAIN\user or COMPUTER\user | For example the account that owns the device or generated the certificate. It is usually a member of the local group IIS_IUSRS. Set Load User Profile to True in the advanced settings of the pool, so that the profile of the account (its Current User store and its registry) is loaded. |

When you change the identity or a setting of the pool, IIS restarts the pool. Wait 20 to 30 seconds, then test again.
What the account needs for PKCS#11
| The account must be able to... | How to check, and what to do |
|---|---|
| read and run the library and the files that it needs | Give Read & Execute on the folder of the manufacturer (for example C:\Program Files\SafeNet\...) to the account. If the account cannot see the file, the server cannot tell "missing" from "not allowed", and says "The driver file does not exist: ...". |
| read the configuration of the device software | The libraries of the HSM clients read a configuration file or the registry, and sometimes an environment variable that points to the file. Check in the documentation of the manufacturer which files, registry keys and variables the library uses, and give the account read access to them. The application pool sees a change of a system environment variable only after IIS is restarted (iisreset in a Command Prompt run as Administrator). |
| read the files of the client of a network HSM | A network HSM client has its own certificate and key files, in the installation folder of the client. The account must be able to read them. |
| reach the device | A USB token or a smart card must be connected to the server, and the services that its software needs (for example the Smart Card service of Windows) must be running. A token that you see only in your remote desktop session is usually not visible to a service. |
| run in the right bitness | Compare the line Processor architecture of the Digital Certificate page with the bitness of the library (section 09.3). |
write in the folder App_Data | The server saves the PIN and the public certificate in its database there (see Installation on IIS). |
Find which side is wrong
- Test inside the server. Test the Certificate runs inside the worker process, with the account of the pool. If it works, the service works too. If the tool of the manufacturer works on your desktop but this test fails, the problem is the account, the rights or the bitness, not the device.
- Test with Digital Certificate Tester (folder
Utilsof the package) on the server, with the same library, slot and PIN, first as you, then as the account of the pool (section 08.12). - Try a known account. Set the identity of the pool to the account with which the tool of the manufacturer works (or, for a quick diagnosis, to LocalSystem), wait 20 to 30 seconds and run the test again. If it works now, the problem is the rights of the account that you used before. Give those rights to the account that you want to keep, and set it back.
- Find the exact file or key that is refused. Run Process Monitor (Windows Sysinternals) on the server, filter on the process
w3wp.exeand on the result ACCESS DENIED, and click the test button. The tool lists the file or the registry key that the account could not open. - Read the audit trail (see Audit Trail). The reason of a failure of the service is recorded there.
Devices used through the Windows store
If you use the device through the Windows certificate store (the CNG or CryptoAPI provider of the device), these points come in addition to the ones above:
- It matters which Windows account generates or installs the certificate: the certificate and the link to its key belong to the store of that account. Use the account of the application pool, or use the Local Machine store.
- The device must be set to not ask for the PIN for this key, so that the server can sign without user intervention (disable the PED PIN, the administrator PIN and any other PIN mechanism that asks for an answer). A PIN window that nobody can see blocks the server. The server reports it as "The private key needs a person to answer (a PIN or a confirmation window), and a service cannot do that. ..."
- Run the application pool under the account in which the certificate was generated, restart IIS, wait 20 to 30 seconds and open the Digital Certificate page again. If the certificate is not in the list, do not go on: the server cannot use a certificate that it does not see.
- A key that the account cannot open is reported as "The server cannot open the private key of the certificate. ..." (Windows: Keyset does not exist) or "The server cannot find the file of the private key for the account that runs it ..." This is usually a rights problem; see section 08.6.2.
Copy a certificate from Current User to Local Computer
IIS cannot use the Current User store of another account. You can make the same certificate available in Local Computer without copying the key. This works for keys that stay on a smart card or on an HSM:
- Open
certmgr.mscand export the public part of the certificate to a file, for exampled:\certificate.cer. - Open the file and note the serial number of the certificate (for example
4e54c00056bbbff410). - In a Command Prompt run as Administrator, import the certificate into the Personal store of the computer. It is imported without the link to the private key:
Command Prompt
certutil -addstore -f "My" "d:\certificate.cer"
- Create the link to the private key. Type the PIN of the device if it is asked:
Command Prompt
certutil -repairstore my "4e54c00056bbbff410"
- The certificate is now in Local Machine, with the link to its key, ready to be selected (see section 08.6.2).
9.6 Useful tricks
- The slot number is only a hint. The server compares the certificates that it can read in the slots without a login with your
.cerfile, and uses the slot that holds it; the configured slot is checked first. If no slot shows the certificate, it looks for the public key of the certificate in the same way. The PIN is sent only to the slot found, never to another device. If no slot shows the certificate or its public key without a login (some HSMs show them only after the login), the configured slot is used. If that slot does not exist, the test says "The signing certificate was not found on the PKCS#11 devices and the slot N does not exist (X slots are present; the first slot is 0)." - How the private key is found. For an RSA key, the server finds the private key by the public key of the certificate, so the device does not need to hold the certificate. For an ECDSA key, it uses the CKA_ID of the certificate on the device or, when the certificate is not there (or has no CKA_ID), the CKA_ID of the public key with the same point. The private key must have the same CKA_ID.
- After a renewal of the certificate, select the new
.cerfile, run the test and set it as current again. If the new certificate has a new key, the key must be on the device and visible to the normal user. - The first request after a pause can be slower. IIS stops an idle worker process (after 20 minutes by default). The next request starts it, loads the library and logs in again. For a busy service, set Idle Time-out (minutes) of the pool (Advanced Settings → Process Model) to 0.
- The PIN is never sent back to the browser. The box is empty when you open the page; leave it empty to keep the saved PIN of the same driver and slot.
- A rejected PIN stays rejected until you run a test (Test the Certificate or Issue a Test Time Stamp), change the settings or restart the application (section 09.4). After you correct the PIN or unlock the device, test once.
- Backups. A backup of the server holds the public certificate and the encrypted PIN, not the key. A restored server needs the device (see Backup, restore, move and upgrade).
9.7 Messages and solutions
The test of the PKCS#11 area shows most of the messages below with the prefix "PKCS#11 error:"; Issue a Test Time Stamp shows them after "Time stamping test error:". When a client request fails, the audit trail records the reason ("Time stamp error: The PKCS#11 signature cannot be created: ..."), and the client receives "TSA Response error.". Parts in ... are filled in by the server (paths, numbers, details of the device).
For example, a 32-bit library selected while the application pool runs as a 64-bit process:

| Message | Cause and solution |
|---|---|
| Enter the path of the PKCS#11 driver (for example C:\Program Files\SafeNet\LunaClient\cryptoki.dll). | The path of the library is empty. |
| The PKCS#11 driver must be on a local disk of the server, not on a network path: ... / ... not on a network drive: ... | The library must be on a local disk. |
| The path of the PKCS#11 driver must be absolute, with the drive letter (for example C:\Program Files\SafeNet\LunaClient\cryptoki.dll): ... | Type the full path, starting with the drive letter. |
| The PKCS#11 driver must be a .dll file: ... | Select the .dll file of the library. |
| The drive of the PKCS#11 driver does not exist: ... | Correct the drive letter. |
| The driver file does not exist: ... | The path is wrong, or the account of the pool cannot read the folder of the library. Check the path on the server and the rights (section 09.5). |
| The slot number must be a number (for example 0). | Type a whole number, 0 or more, in Slot number. |
| The number of parallel sessions must be between 1 and 64. | Correct Parallel sessions. |
| Select the certificate file (.cer, the public part). | Select the .cer file. Without a file, the test works only for the current PKCS#11 certificate on the same driver and slot. The browser does not keep the file after each action: select it again before you click the test. |
| The certificate file is not valid: ... | The file is not an X.509 certificate. Export the certificate again (DER or Base64 .cer). |
| No PKCS#11 device is present. | The library was loaded, but it reports no device to the account of the pool. Check that the device is connected to the server, that its software is installed and configured for this account, the rights of section 09.5 and, for a network HSM, that the partition is activated and the server is registered as a client. |
| The PKCS#11 library ... cannot be used: it is not a 64-bit library, while the server runs as 64-bit. Select the 64-bit version of the library of the device (or change the 32-bit setting of the IIS application pool). | The library has another bitness than the application pool (the message names the bitness of the server). Select the library with the same bitness as the pool. |
| The PKCS#11 library ... cannot be loaded (...). Check that it is the 64-bit version of the library and that the software of the device is installed. | Windows cannot load the library: a missing dependency, software of the device not installed, or a file that is not a PKCS#11 library. Select the library of the manufacturer (usually cryptoki.dll or a name of the product). |
| The signing certificate was not found on the PKCS#11 devices and the slot N does not exist (X slots are present; the first slot is 0). | No device shows the certificate and the slot number is out of range. Use a slot from 0 to X-1, and check that the certificate is on the device. |
| The PKCS#11 device rejected the PIN (CKR_PIN_INCORRECT). To avoid locking the device, the PIN is not sent again until the PKCS#11 settings are changed, the PKCS#11 connection is tested or the application is restarted. | The PIN is wrong. Other codes: CKR_PIN_LOCKED (the device is locked), CKR_PIN_EXPIRED (the PIN must be changed), CKR_PIN_LEN_RANGE and CKR_PIN_INVALID (the PIN has a wrong format). Correct the cause, then test once (section 09.4). |
| The private key of the selected certificate was not found on the device (session state ..., N private keys visible). | The device holds no private key that matches the public key of the .cer file: a wrong file, a renewed certificate with a new key, another partition, or a key that the normal user cannot see. The details in brackets show whether the login worked and how many private keys the user sees. |
| The EC private key of the selected certificate cannot be identified: neither the certificate nor its public key was found on the PKCS#11 device (or they have no CKA_ID) ... | For an ECDSA key, the device must hold the certificate or the public key, with a CKA_ID (section 09.6). |
| The EC private key of the selected certificate was not found on the device ... | No ECDSA private key has the CKA_ID of the certificate or of its public key. |
| The test signature of the PKCS#11 device does not match the public key of the selected certificate. | The device signed, but the signature does not verify with the certificate that you selected. The .cer file and the key that the server found do not belong together. |
| The signature made by the PKCS#11 device does not match the public key of the certificate: the device signs with a key that does not belong to the certificate. | The same problem, found on the first signature of a session. |
| Only RSA and ECDSA keys are supported. | The certificate has another type of key. |
| Post-quantum (ML-DSA) keys can be used from a PFX file or from the Windows certificate store, not from a PKCS #11 device. Select the certificate as a PFX file or in the Windows certificate store. | An ML-DSA certificate. Use it from a PFX file or the Windows store (see section 08.4). |
| The selected certificate cannot be used for time stamping: ... | The device works, but the certificate does not meet the rules of a time stamp certificate (see section 08.1). |
| The PKCS#11 signature cannot be created: ... | Recorded in the audit trail when signing a time stamp failed. The text after the colon is the cause, for example one of the messages above. |
10. Server settings
The Configuration page of PKISimple TSA Server holds the options of the time stamps and the access to the server. Open it with Configuration in the menu bar or on the main page.
The server reads a saved configuration from the next request (the other worker processes within a second): nothing needs to be restarted.

The page has three parts: Time Stamp Certificate, Settings and Authentication, and the bottom bar with ← Main Page, Restore Defaults and Save Configuration.
Two options that were on this page in earlier versions are elsewhere now:
- Log all responses and the retention of the response log are on the Time Stamp Responses page (chapter 13).
- The users and their maximum number of time stamps are on the Users page, opened with Manage Users (chapter 11).
10.1 Time Stamp Certificate
The top of the page describes the certificate that signs the time stamps: Certificate location (PFX file, Windows certificate store or PKCS#11 device), Certificate subject, Serial number, Thumbprint, Valid from, Key and signature and Private key. Above it, the page shows the same certificate warnings as the main page (certificate that cannot be used, expired, or expiring within 30 days; clock marked as wrong).
| Button | What it does |
|---|---|
| Select the Digital Certificate | Opens Select Certificate: a PFX file, the Windows certificate store or a PKCS#11 device (chapter 8, chapter 9). |
| Create New Certificate | Opens Create Certificate (chapter 8). |
| Issue a Test Time Stamp | Issues a time stamp inside the server and verifies it (see 10.5). |
10.2 Settings
The defaults below are those of a new installation, and those that Restore Defaults fills in.
| Setting | What it does | Default |
|---|---|---|
| Time Stamp Response Hash Algorithm | The hash algorithm with which the server signs the time stamps. See below. | The same as on the Time Stamp Request (minimum SHA-256) |
| Time Stamp Server Policy ID | The policy OID that the server writes in every time stamp. It must be a valid OID. | 1.3.6.1.4.1.1.2.1.2 |
| Time Stamp Request must include the current Time Stamp Server Policy ID | Also refuses the requests that name no policy. | Off |
| Set Ordering to True | Sets the ordering field of the time stamps to true: the time stamps of the server can be ordered by their time, whatever the accuracy. | Off |
| Time Stamp Request must include a nonce | Refuses the requests without a nonce. | Off |
| Include whole chain on the Time Stamp Response | Puts the chain of the certificate in the responses, not only the certificate. | Off |
| Use the legacy ESSCertID attribute (SHA-1) | Identifies the certificate with ESSCertID (SHA-1) instead of ESSCertIDv2. | Off |
| Include the qcStatements extension | Declares the time stamps as qualified electronic time stamps. | Off |
| Do not encode Authenticode responses as BASE64 | Sends the Authenticode responses as binary instead of Base64. | Off |
| Set Accuracy with Seconds, Milliseconds, Microseconds | Writes the accuracy of the time in the time stamps. | Off; 0, 0, 0 |
Time Stamp Response Hash Algorithm
| Choice | Effect |
|---|---|
| The same as on the Time Stamp Request (minimum SHA-256) | A request made with SHA-256, SHA-384 or SHA-512 is signed with the same algorithm; a request made with SHA-1, SHA-224, SHA-3 or another algorithm is signed with SHA-256. Authenticode requests, which name no algorithm, are signed with SHA-256. |
| SHA-1 (legacy, not recommended) | Every response is signed with SHA-1. Use it only for a client that cannot verify anything else. |
| SHA-256, SHA-384, SHA-512 | Every response, RFC 3161 and Authenticode, is signed with that algorithm. |
The hash of the client's data inside the time stamp (the message imprint) is never changed. The server accepts message imprints made with SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 and SHA3-224 to SHA3-512; requests made with another algorithm (for example MD5) are refused.
When you save the configuration with SHA-1 (legacy, not recommended), the page saves it but shows a warning: "The time stamps are signed with SHA-1, which modern verifiers refuse and ETSI EN 319 422 does not allow; a SHA-1 signature also identifies the certificate with the legacy ESSCertID (SHA-1)."
ML-DSA certificate. When the certificate has a post-quantum ML-DSA key, the page notes under the list that the time stamps always use SHA-512 and ESSCertIDv2 (RFC 9882): this option and Use the legacy ESSCertID attribute (SHA-1) apply only to RSA and ECDSA certificates (chapter 8).
Policy
- The server always writes its own Time Stamp Server Policy ID in the time stamps.
- A request that names another policy is always refused (failure unacceptedPolicy): "Invalid TSA Request. The TSA Policy ID is not accepted by the TSA Server (requested …, the server issues …)."
- With Time Stamp Request must include the current Time Stamp Server Policy ID, a request that names no policy is refused too: "Invalid TSA Request. TSA Policy ID field must be set."
- A value that is not an OID is not saved: "The TSA policy ID is not a valid OID (for example 1.3.6.1.4.1.13762.3)."
Most clients send no policy, so leave the check box off unless all your clients send the policy of the server.
Nonce
A nonce is a random number that the client puts in its request; the server copies it into the time stamp, so the client can match the response with its request. With Time Stamp Request must include a nonce, an RFC 3161 request without a nonce is refused (failure badRequest) with "Invalid TSA Request. NONCE field must be set."
Certificates in the response
The certificates are sent only when the request asks for them (the client option certReq, for example -cert in openssl ts -query).
- Without Include whole chain on the Time Stamp Response: the response has the certificate of the server only.
- With it: the certificate of the server and its chain. From a PFX file, only the certificates of the chain of the server certificate are added. The responses are larger.
ESSCertID and ESSCertIDv2
By default the time stamps identify the certificate of the server with ESSCertIDv2 (RFC 5816), hashed with the algorithm of the signature. Tick Use the legacy ESSCertID attribute (SHA-1) only for very old verifiers that require ESSCertID (RFC 3161). When you save with it, the page warns: "The time stamps identify the TSA certificate with the legacy ESSCertID (SHA-1) instead of ESSCertIDv2 (RFC 5816), which ETSI EN 319 422 requires."
A signature made with SHA-1 always uses ESSCertID.
qcStatements
Include the qcStatements extension adds the qcStatements extension with esi4-qtstStatement-1 (ETSI EN 319 422): the time stamp declares itself a qualified electronic time stamp (eIDAS, Regulation (EU) No 910/2014). Tick it only when the server is operated as a qualified time stamp service.
The server never copies an extension of a request into a time stamp: a request that carries any extension is refused (failure unacceptedExtension).
Authenticode responses
The answers to Authenticode requests are normally encoded in Base64, which is what the Windows signing tools expect. Tick Do not encode Authenticode responses as BASE64 only for a client that needs the binary answer.
Accuracy
With Set Accuracy, the time stamps carry the accuracy of their time: the largest difference you guarantee between the time in the time stamp and the real time (UTC). The three boxes can be typed only while Set Accuracy is ticked.
| Box | Allowed values |
|---|---|
| Seconds | A whole number, 0 or greater |
| Milliseconds | A whole number from 0 to 999 |
| Microseconds | A whole number from 0 to 999 |
At least one value must be greater than 0; values that are 0 are not written in the time stamp. Set only an accuracy that your time source really guarantees (chapter 4).
| Message | Cause |
|---|---|
| "The accuracy (seconds) must be a whole number, 0 or greater." | Not a number, or negative. |
| "The accuracy (milliseconds) must be a whole number from 0 to 999." (or microseconds) | Out of range. |
| "With Set Accuracy, at least one of the accuracy values (seconds, milliseconds, microseconds) must be greater than 0." | All three are 0. |
10.3 Authentication
| Setting | What it does | Default |
|---|---|---|
| Require authentication | Only the users of the Users page can obtain time stamps: every request must carry the user name and password of an enabled user. | Off |
Manage Users opens the Users page. Create the users first, give the credentials to the clients, then tick Require authentication and click Save Configuration. Details: chapter 11.
10.4 Save Configuration and Restore Defaults
Save Configuration checks the values and saves the whole page. The changed options are written to the Audit Trail as Configuration changed, with the old and the new value of each (chapter 12).
| Message | Meaning |
|---|---|
| "The configuration was saved." | Saved; the server uses it from the next request. |
| "The configuration was saved. Warning: …" | Saved, with the SHA-1 or ESSCertID warning described above. |
| "The configuration cannot be saved: …" | Nothing was saved; the reason follows (an invalid OID or accuracy, for example). |
| "The configuration cannot be saved: The configuration was changed meanwhile (on another page or by another worker process), so this change was not saved. Open the page again and repeat it." | Somebody saved the configuration after you opened the page. Open the page again and repeat the change. |
Restore Defaults asks first ("Fill the form with the default settings? The certificate is kept. Nothing changes until you click Save Configuration."). Click Fill in Defaults to fill the form with the defaults of 10.2 and 10.3; the page says "The default settings are filled in. Click Save Configuration to use them." The certificate is kept. Nothing is saved until you click Save Configuration; if you leave the page before, the browser asks first (chapter 5).
10.5 Issue a Test Time Stamp
Issue a Test Time Stamp issues a time stamp inside the server with the saved configuration and verifies it. It saves nothing.
- Success: "The test time stamp was issued and verified. Time (UTC): …"
- Failure: "Time stamping test error: …" with the reason (for example a key that cannot be used).
- If the page has changes that are not saved, the message ends with "Unsaved changes on this page were not used: save them first."
The test runs as the administrator: it needs no user, even with Require authentication, and does not count toward the maximum of any user. It counts as an issued time stamp on the main page and in the trial period, and appears in the response log (when Log all responses is on) with the user internalTestOperation.
The test does not go through the network. To test the time stamp address as a client does, send a request from another program (chapter 15), for example:
openssl ts -query -data file.txt -sha256 -cert -out req.tsq
curl -H "Content-Type: application/timestamp-query" --data-binary @req.tsq http://<server>/tsa/get.aspx -o resp.tsr
openssl ts -reply -in resp.tsr -textThe Status page also runs a test time stamp and a test of the public address every day (chapter 14).
11. Users and client authentication
By default anybody who can reach PKISimple TSA Server can obtain a time stamp. With Require authentication, the server accepts only the users that you create, and it can limit the number of time stamps of each one. This chapter describes the Users page, how the clients send their credentials, and what they receive when they are refused.
11.1 How authentication works
- The users are created on the Users page: Configuration → Authentication → Manage Users. The menu bar underlines Configuration while the Users page is open.
- The users are checked only while Require authentication is ticked and saved on the Configuration page (chapter 10). Until then the Users page says "Authentication is off: the server does not check these users. Turn on Require authentication in Configuration to use them."
- With authentication on, every request must carry the user name and password of an enabled user. Requests without credentials, with a wrong password, from a disabled user or from a user over its maximum are refused.
- The tests of the administration pages (Issue a Test Time Stamp, Time Stamp a File, the tests of the Status page) need no user and do not count toward the maximum of any user.
Recommended order: create the users, give the credentials to the clients, test with one client, then tick Require authentication and click Save Configuration. Until then the Users page reminds you that the users are not checked.
11.2 The Users page

Add a User
| Field | Meaning | Default |
|---|---|---|
| Username | The user name that the client sends. It cannot be empty or contain spaces. User names are not case-sensitive: Client1 and client1 are the same user. | — |
| Password | The password that the client sends. It cannot be empty. The box shows what you type. | — |
| Maximum requests | The number of time stamps the user can obtain. | 10000 |
| User is enabled | A user that is not enabled is refused. Clear it to suspend a user without deleting it. | Ticked |
| Unlimited requests | No maximum for this user (the Maximum requests box then shows "Unlimited"). | Not ticked |
Click Add User. The page says "The user name was added." and shows the time stamp address for this user (see 11.3).
| Message | Cause |
|---|---|
| "The user name is required." / "The user name cannot contain spaces." / "The password is required." | The user name or the password is not valid. |
| "The user name is already in use." | A user with this name exists already. |
| "The maximum number of requests is not valid." | Maximum requests is not a whole number of 0 or more. |
The server stores a hash of the password, never the password itself.
All users
| Column | Meaning |
|---|---|
| No. | The row number. |
| Username | The user name. |
| Requests | The time stamps issued to the user. |
| Maximum | The maximum, or "Unlimited"; "(limit reached)" is added when the user has reached it. |
| Creation date (UTC) | The day the user was created. |
| Is active | "Active" or "Inactive" (User is enabled). |
| Change | Shows the user in the form, to change it. |
| Delete | Shows the user in the form, to delete it. |
When there are no users, the page says "No users found."
Change fills the form with the user (title "Change the user name"). The user name cannot be changed. The password box shows ******: leave it so to keep the password, or type a new one. Change Maximum requests, Unlimited requests or User is enabled as needed and click Save Changes (or Cancel). The page says "The user name was changed." When the password was changed, the page shows the new address of the user once.
Delete shows the user in the form (title "Delete the user name?") with the red button Delete User. The browser asks "Delete the user name? Its request counter is deleted too. This cannot be undone." A deleted user can be created again; its counter then starts at 0.
The additions, changes and deletions are written to the Audit Trail (TSA user added, TSA user changed, TSA user deleted; chapter 12).
Export CSV
Export CSV downloads TSAUsers.csv with the columns No, Username, Requests, Maximum, CreationDate (ISO 8601, UTC) and IsActive. Passwords are not exported.
11.3 The address for the client
After Add User, or after a password is changed, the page shows once a box Time stamp address for name with the full time stamp address and the user's credentials, already percent-encoded, for example:
https://tsa.example.com/tsa/get.aspx?u=client1&p=S3cret%26Pass
Click Copy and give the address to the user's time stamping client. The address contains the password and is not shown again (the server keeps only the hash of the password): to obtain a new address, set a new password with Change. Clients that support HTTP Basic authentication can use the plain address with the user name and password instead.
The address is built from the address of the page in your browser. If you opened the page as http://localhost/…, replace localhost with the name of the server that the clients use.
11.4 How a client sends the credentials
The client sends its credentials with each request, to the same address (get.aspx), in one of two ways.
HTTP Basic authentication (recommended)
The client sends the header Authorization: Basic with user:password in Base64. Clients that have a user name and password setting for the time stamp server use it. With curl:
curl -u user:password -H "Content-Type: application/timestamp-query" --data-binary @req.tsq https://tsa.example.com/tsa/get.aspx -o resp.tsrThe server does not ask for credentials with an HTTP 401 challenge: the client must send the header with the request. IIS must not ask for its own authentication on the application either: only Anonymous Authentication is enabled (chapter 3).
In the address (query string)
For clients that accept only an address, put the credentials in it:
https://tsa.example.com/tsa/get.aspx?u=user&p=passwordFor example with signtool (Windows SDK):
signtool sign /fd sha256 /tr "https://tsa.example.com/tsa/get.aspx?u=user&p=password" /td sha256 file.exe
signtool sign /fd sha256 /t "https://tsa.example.com/tsa/get.aspx?u=user&p=password" file.exeThe first line requests an RFC 3161 time stamp, the second an Authenticode time stamp. Keep the quotes: without them the command prompt treats & as the end of the command.
Percent-encoding. Characters that have a special meaning in an address must be percent-encoded in the user name and in the password:
| Character | Write |
|---|---|
& | %26 |
+ | %2B |
# | %23 |
% | %25 |
| space | %20 |
For example the password a&b+c is written p=a%26b%2Bc. The address shown by the Users page is already encoded.
When a request carries both a Basic header and credentials in the address, the Basic header is used.
Security
Basic authentication and the query string both send the password readable unless the connection is HTTPS: use HTTPS when the clients connect from other networks. A password in the address can also end up in the IIS log, in the logs of proxies and in the configuration of the client: prefer Basic authentication where the client supports it (chapter 21).
11.5 Counters and the maximum
- The Requests column counts the time stamps issued to the user. A request that is refused (for a nonce, a policy, a certificate problem or any other reason) does not count.
- When the user reaches its maximum, its requests are refused until you raise Maximum requests or tick Unlimited requests.
- The counts are kept in memory and written to the database in the background. The Users page and Export CSV show the counts of the worker process that answers the page and the counts already written by the others.
- With several worker processes (a web garden), the processes see each other's counts only after their next write, so together they can pass a maximum by a few requests.
11.6 Refusals and lockout
| Text sent to the client | Cause |
|---|---|
| "Invalid credentials to login to the TSA server." | No user name, an unknown user, or a wrong password. |
| "User is not active." | User is enabled is not ticked. |
| "Not enough time stamp requests." | The user reached its maximum. |
| "Too many failed authentication attempts. Try again later." | The client is locked out for a while (see below). |
Every refusal is written to the Audit Trail with its reason and the IP address of the client (chapter 12).
Lockout after failed attempts. After five failed authentications from the same IP address, or for the same user from the same IP address, the server refuses the requests with credentials from that client for 1 minute; each new failure doubles the time (2, 4, 8 minutes), up to 15 minutes. The count is cleared by a successful authentication, or after 30 minutes without failures. The count is per IP address, not per user alone: wrong passwords sent from one address do not lock out a client that uses the same account from another address. During a lockout, a request that carries a password the server has already accepted for that user is still served, so a client that knows the right password is not locked out by somebody else's wrong attempts.
The counts are kept in memory by each worker process, and start again after a restart of the application.
11.7 What the client receives when it is refused
RFC 3161 requests receive an RFC 3161 response, not an HTTP error: HTTP 200, content type application/timestamp-reply, status rejection with the text of the table above and the failure information systemFailure. The client shows the text, for example:
Status info:
Status: Rejected.
Status description: Invalid credentials to login to the TSA server.Authenticode requests have no error format: the server answers with HTTP status 403 and the text of the table above (content type text/plain). The signing tool shows that the time stamp request failed.
The other reasons of refusal (policy, nonce, clock, trial period, certificate) are described in chapter 10, chapter 18 and chapter 22.
12. Audit Trail
PKISimple TSA Server records its events in the audit trail: the administrative actions (logins, changes of the configuration, of the certificate and of the users, backups), the requests it refused, and the errors of the server. The trail is kept in the database of the server and every entry is chained to the previous one, so a change made outside the server is detected.
Open it with Audit Trail in the menu bar. All times are UTC.

12.1 The table
The events are shown newest first, 25 per page. The pager above the table (and below it, when the page is long) shows the position ("1–25 of 1,851"), the buttons First, ‹ Previous, Next › and Last, and Rows, where you choose 25, 50 or 100 rows per page. Each page reads only its own rows from the database, so every entry can be reached even in a trail of millions of entries.
| Column | Content |
|---|---|
| No. | The number of the entry, in the order in which the entries were written. After old entries were deleted (12.7) the numbering does not start again from 1. |
| Time (UTC) | The time of the event, to the second. |
| Event | The type of the event (12.8). Hold the mouse over it to see its code (for example TSA_CONFIGURATION_CHANGED). |
| IP | The address of the computer that caused the event; localhost for events of the server itself (the daily tests, the background work). |
| Message | What happened. A message longer than one line, or longer than about 200 characters, shows its first line followed by ... more: click it to read the whole message. |
Levels. Each event has a level:
| Level | Shown as |
|---|---|
| Information | A normal row. |
| Warning | A yellow row with a Warning badge. |
| Error | A red row with an Error badge. |
Under the table: "Times in UTC. Client request errors are recorded up to 60 per minute; the excess is summarized."
12.2 The default view: refused client requests are hidden
A server on a network receives requests from many clients, and some of them are refused because of the client: a malformed request, wrong credentials, a used-up quota, a policy or a hash algorithm that the server does not accept. A busy server can record thousands of such refusals a day, which would hide the events that matter to the administrator.
The event list therefore starts with All events (excluding refused time stamp requests). It leaves out the warning-level entries of the types Refused time stamp request and Refused Authenticode request. The error-level entries of those types are still shown: they are failures of the server (for example "Time stamp error: …", or the end of the trial period), not of the client.
When the view hides entries, a line above the table says how many, for example:
1,204 refused client request(s) hidden — show themshow them repeats the same search with All events. To see only the refusals, choose Time stamp requests (all) or one of its types in the event list (12.4).
12.3 The rate limit of client request events
The events caused by time stamp requests are written to the trail at most 60 per minute (in each worker process of the application pool). The others of that minute are counted, and the count is written at the start of the next minute:
312 more request errors in the previous minute were not logged (at most 60 per minute).Failed authentications are summarized separately, per IP address and user name, so that a flood of other bad requests cannot hide them (event Failed authentications (summary)):
45 more failed authentications for the user alice from this IP in the previous minute (over the limit of 60 logged events per minute).The limit protects the disk (and the quota of a hosting plan) from a client that sends bad requests without end. The administrative events and the errors of the server are not limited.
12.4 Search and filters
The search bar above the table:
| Field | What it does |
|---|---|
| Text box ("Text of the message or IP address") | Finds the entries whose message or IP address contains the text, exactly as typed (no wildcards; upper and lower case are not distinguished for Latin letters). |
| Level: All levels, Errors, Warnings, Information | Only the entries of that level. |
| Event list | All events (excluding refused time stamp requests) (the default, see 12.2), All events, then each group of events (for example Administration (all)) followed by its event types. |
| Month: All months, then each month that has entries | Only the entries of that month (UTC). |
| Search | Shows the first page of the result. |
| Export CSV | Downloads the result (12.5). |
The filters are combined: for example Warnings + Administration (all) + a month shows the failed logins and the refused license texts of that month.
12.5 Export CSV
Export CSV downloads every entry of the current search (not only the page on the screen), oldest first, as TSAServer_Audit_yyyyMMdd_HHmm.csv (UTF-8, readable by spreadsheet programs). The columns are:
| Column | Content |
|---|---|
| No. | The number of the entry. |
| Time (UTC) | The exact time, ISO 8601 with milliseconds, for example 2026-11-13T04:47:53.123Z. |
| Level | Info, Warning or Error. |
| Event type | The code of the event, for example BACKUP_CREATED. |
| Event | The name of the event, as on the page. |
| IP | The address of the client. |
| Message | The whole message. |
The export itself is recorded in the trail (Audit trail exported, with the filters used).
12.6 Integrity of the trail
Each entry carries the SHA-256 hash of the previous entry and of its own content, and the server keeps a record of the last entry. An entry changed, inserted or deleted outside the server (for example by editing the database file), also one of the last entries, breaks the chain.
At each load of the page the server checks the entries written since its previous check, and shows the result in the line at the top of the page:
| Line | Meaning |
|---|---|
| Green: "Integrity: hash chain intact." | The new entries follow the chain. |
| Green: "Integrity: the whole audit trail was verified." | Shown after Verify the Whole Trail: every entry was checked. |
| Yellow: the same text followed by "… event(s) could not be written since the application started (last: …)" | The chain is intact, but some events were lost because the database could not be written at that moment (for example a full disk). A lost event leaves no trace in the chain, so the page says it here. See also the Audit trail line of the Status page. |
| Red: "Integrity: the audit trail was modified outside the server." followed by the first problem found | See the table below. |
Verify the Whole Trail (bottom bar) checks every entry, from the first one. It can take a while on a trail of millions of entries. The result is written to the trail (Audit trail verified). The daily tests of the Status page make the same full check once a day, and the check of a backup checks the chain of the backup file (Backup, restore, move and upgrade).
The problems that the check reports:
| Message | Meaning |
|---|---|
| The entry N was changed. | The content of entry N is not the content that was chained. |
| The entry N does not follow the previous entry (an entry before it was deleted or inserted). | An entry was removed or added before N. |
| The last entries (after the entry N) were deleted. | The trail ends before the last entry recorded by the server. |
| The last entry is not the one recorded by the server. | The record of the last entry does not match the trail. |
| The start of the trail was moved after the entry N without a record of a deletion: entries were deleted outside the server. | Old entries were removed without Delete Old Entries. |
What to do: the database was modified while the server did not write it. Find out who had access to the folder App_Data\settings, keep a copy of the database as evidence, and, if the trail must be trusted, restore the last backup whose check reports an intact chain (Backup, restore, move and upgrade).
12.7 Delete old entries
The trail grows with the life of the server. The section Delete old entries at the bottom of the page deletes the oldest entries, to keep the database small:
- Choose the last month to delete in the list: Up to month (inclusive). The list offers only the months before the current one; when there is none it shows "No month before the current one".
- Type the administrator password.
- Click Delete Old Entries and confirm.
The rules:
- The selected month and every earlier month are deleted. Only the oldest entries can be deleted: entries in the middle of the trail cannot, because the chain would break.
- The current month cannot be deleted.
- The deletion is recorded in the trail itself (Audit trail entries deleted: how many entries, which numbers, the new start of the chain, the time and the IP address). The trail stays verifiable: the check accepts the new start only because this entry records it.
- The deletion cannot be undone. Export the months that you must keep (Export CSV with that month selected), and keep a backup made before the deletion.
The result is shown at the top of the page, for example "12,480 entries up to October 2026 were deleted. The deletion is written to the trail."
Source Edition: there is no password box; the deletion asks only for the confirmation of the browser.
12.8 The events that are recorded
The event list of the page groups the event types as below. The level is the usual level of the type; some types take their level from the message, as noted.
Administration
| Event | Code | Level | Recorded when |
|---|---|---|---|
| Login | ADMIN_LOGIN | Information; Warning for a failed login or a wrong administrator password typed again (for a backup download, a restore, a deletion of audit entries) | The administrator logs in, or a login fails. |
| Logout | ADMIN_LOGOUT | Information | The administrator logs out. |
| Administrator account reset | ADMIN_ACCOUNT_RESET | Information | The account was replaced with the one-time code of reset-admin.txt (License agreement and the administrator account). |
| Failed account reset | ADMIN_RESET_FAILED | Warning | A wrong reset code was typed. |
| License registered | LICENSE_REGISTERED | Information | A license text was registered (Trial period and registration). |
| License refused | LICENSE_REFUSED | Warning | A text that is not a valid license was pasted. |
| License agreement accepted | TERMS_ACCEPTED | Information | The license agreement was accepted at the installation. |
| Trial: maximum of time stamps reached | DEMO_LIMIT_REACHED | Warning | The trial issued its 5,000 time stamps. |
| Trial period ended | DEMO_EXPIRED | Warning | The 45 days of the trial ended. |
| TSA user added / TSA user changed / TSA user deleted | CREATE_USER / CHANGE_USER / DELETE_USER | Information | A change on the Users page (Users and authentication). |
Configuration
| Event | Code | Level | Recorded when |
|---|---|---|---|
| Configuration changed | TSA_CONFIGURATION_CHANGED | Information | Settings were saved (Configuration page, or the response log settings of the Time Stamp Responses page); the message lists the changes. |
| TSA certificate created | TSA_CERTIFICATE_CREATED | Information | The server created a certificate (at the installation, or on Create Certificate). |
| TSA certificate changed | TSA_CERTIFICATE_CHANGED | Information | Another time stamp certificate was set as current. |
| Database restored from a backup | BACKUP_RESTORED | Information | A backup was restored; written to the restored trail. |
Time stamp requests
| Event | Code | Level | Recorded when |
|---|---|---|---|
| Refused time stamp request | ISSUING_TSA_RESPONSE_ERROR | Warning; Error when the server failed ("Time stamp error: …", a response that could not be created) or the trial stopped the time stamps | An RFC 3161 request (or a request that is neither RFC 3161 nor Authenticode) was refused. The message gives the reason, for example "Incorrect password (invalid credentials).", "Not enough time stamp requests.", "Invalid RFC 3161 request: the body is not a valid TimeStampReq." Also the summary line of the rate limit (12.3). |
| Refused Authenticode request | ISSUING_TSA_AUTHENTICODE_RESPONSE_ERROR | As above | The same for an Authenticode request. |
| Failed authentications (summary) | TSA_AUTHENTICATION_FAILURES | Warning | The failed authentications over the rate limit, one line per IP address and user (12.3). |
| Apply Timestamp page error | ONLINE_TSA_REQUEST | Warning | Time Stamp a File failed (Testing the server). |
| Verify page error | VERIFY_RESPONSE_ERROR | Warning | Verify a Time Stamp could not read a file. |
Checks and backups
| Event | Code | Level | Recorded when |
|---|---|---|---|
| Backup made on the server | BACKUP_CREATED | Information | Make a Backup on the Server. |
| Backup downloaded | BACKUP_DOWNLOADED | Information | Download a Backup, or the download of a backup of the server. |
| Backup file checked | BACKUP_CHECKED | From the result of the check: Error, Warning or Information | A backup file was checked; the message holds every result. |
| Status tests | STATUS_TESTS | Information; Warning when the message starts with "Passed with warnings"; Error when it starts with "Failed" | The tests of the Status page ran (daily, or from the page). |
| Audit trail verified | AUDIT_TRAIL_VERIFIED | Information; Error when a problem was found | Verify the Whole Trail. |
| Audit trail exported | AUDIT_EXPORTED | Information | Export CSV of this page. |
| Audit trail entries deleted | AUDIT_PURGED | Warning | Delete Old Entries (12.7). |
| Response log entries deleted | RESPONSE_LOG_DELETED | Warning | Entries of the response log were deleted by the administrator (Time Stamp Responses). |
| File and storage maintenance | IO_OPERATION | Information; Error when a file operation failed | Maintenance work of the server, for example the hourly deletion of the response log entries older than the retention period. |
Errors
| Event | Code | Level | Recorded when |
|---|---|---|---|
| Configuration error | TSA_CONFIGURATION_ERROR | Error | A request found a configuration that cannot be used (the certificate expired or not yet valid, an invalid setting, a certificate that cannot be loaded after a restore). |
| Clock marked invalid | INVALID_TSA_TIME_ERROR | Error | A request was refused while an external clock monitor marks the clock as wrong (Synchronize the clock). |
| Database error | DATABASE_ERROR | Error; Warning for the response log entries that were dropped | The database could not be used, failed its integrity check, or could not keep up with the response log (Time Stamp Responses). When the database cannot be opened at the start, the page shows the cause in a red box ("The server could not open its database: …"); it is also in App_Data\settings\startup-error.txt and is moved into the trail when the database works again. |
13. Time Stamp Responses
The Time Stamp Responses page of PKISimple TSA Server shows the responses that the server sent: the latest ones, always, and, when Log all responses is on, every response in a log that you can search and export. Open it with Responses in the menu bar. All times are UTC.
The response log is the record of the time stamps that the server issued: which user and which IP address received a time stamp, when, with which serial number and which certificate. The refused requests are recorded too, with the reason. The Audit Trail is a different record: it holds the administrative events and the errors, and the refused requests only up to 60 per minute.

13.1 The settings of the response log
The section Response log at the top of the page:
| Setting | Meaning |
|---|---|
| Log all responses | When ticked, every response is stored in the database: granted and refused, RFC 3161 and Authenticode, from every worker process of the application pool, including the test time stamps of the administration pages. Off by default. |
| Keep the entries for n months (0: keep forever) | The retention period: a whole number from 0 to 1200 (default 12). The entries older than this are deleted automatically, at most once an hour; the deletion is recorded in the audit trail (File and storage maintenance). 0 keeps every entry. |
| Save | Saves the two settings. Nothing is saved before you click it. The change is recorded in the audit trail (Configuration changed). |
A message confirms the change ("Saved: …") or says "Nothing was changed.".
Space on the disk. Each logged response takes a small row in the database, but a busy server issues many: check the size of the database on the Status page after the first weeks and choose the retention period accordingly.
How the log is written. A request never waits for the log. The entries wait in memory and the background writer of the server stores them, normally every second. When the database cannot keep up, or cannot be written, at most 100,000 entries wait (setting Tsa.ResponseLogMaxBuffered of Web.config); beyond that the new entries are dropped and counted. The time stamps themselves are issued normally. The dropped entries are reported in the audit trail (Database error, as a warning, at most once a minute), on the Status page (line Response log) and on the Backup and Restore page (Backup, restore, move and upgrade). A crash of the worker process can lose the entries of the last second.
13.2 Latest responses
The table Latest responses shows the last responses, newest first: type a number from 5 to 100 (default 20) and click Refresh.
- They are kept in the memory of the worker process that answers the page, also when Log all responses is off: it is the quick way to see what the clients are receiving now.
- They start empty when the application starts ("No time stamp request since the application started.").
- When the application pool has several worker processes (a web garden), each process shows its own responses.
The columns are those of the log (13.3), without No.
13.3 The columns
| Column | Content |
|---|---|
| No. | The number of the entry in the log. |
| Time stamp (UTC) | The time written in the time stamp, to the second: the genTime of an RFC 3161 time stamp, the signing time of an Authenticode time stamp. Empty for a refused request, which has no time stamp. |
| Logged (UTC) | The time at which the response was recorded, to the millisecond, a few milliseconds after the signature. The period filter of the search uses this time. |
| Response | Granted, or a yellow Refused badge (the whole row is yellow). |
| Protocol / Hash | RFC 3161 or Authenticode, and the hash algorithm of the signature of the response, for example RFC 3161 / SHA-256. |
| User | The user who sent the request (Users and authentication); (anonymous) when the request carried no user name; internalTestOperation for the test time stamps of the administration pages. |
| IP | The address of the client. |
| Serial number | The serial number of the time stamp, in decimal. RFC 3161 time stamps only: the Authenticode format has no serial number. |
| Message | The reason of a refusal, for example "Invalid credentials to login to the TSA server.". A long message shows its first line and ... more. |
Hold the mouse over a row to see the TSA certificate that signed it.
A request that the server cannot read at all (a body that is neither an RFC 3161 nor an Authenticode request) gets no time stamp response, so it is not in this log; it is recorded in the Audit Trail.
13.4 Search the log
The section Search the log is shown while Log all responses is on, or while the log still holds entries. Choose the filters and click Search:
| Filter | Values |
|---|---|
| Period | Today (the default), Yesterday, Last 7 days, This month, Last month, each month that has entries, All periods. UTC days and months, by the Logged time. |
| User | The user name, whole and exact (upper and lower case do not matter). |
| IP address | The whole address, exact. |
| Serial number | The serial number of a time stamp, in decimal. It is searched in all periods: the period filter is ignored. |
| Response | All responses, Granted, Refused. |
| Protocol | All protocols, RFC 3161, Authenticode. |
| Hash algorithm | All hash algorithms, SHA-1, SHA-256, SHA-384, SHA-512, SHA-224. |
| TSA certificate | All TSA certificates, or one of the certificates that signed the logged responses (common name and serial number). |
The result is shown newest first, 25 per page (50 or 100 can be chosen in Rows), with First, ‹ Previous, Next › and Last above the table and, for a long page, below it. Every match can be reached page by page.
The search by user and by serial number uses indexes and stays fast with tens of millions of entries. The last pages of a very large result take longer to read: narrow the period or add a filter instead.
Finding a time stamp. Programs usually show the serial number of a time stamp in hexadecimal (OpenSSL, for example, prints Serial number: 0x08DF2483F445C922). The page needs the decimal number. Convert it, for example in PowerShell (add a 0 before the hexadecimal digits):
[bigint]::Parse('008DF2483F445C922', 'AllowHexSpecifier').ToString()The pages of the server (Time Stamp a File, Verify a Time Stamp) show the serial number in decimal already.
13.5 Export CSV
Export CSV downloads every response of the current search (not only the page on the screen), oldest first, as TSAServer_Responses_yyyyMMdd_HHmm.csv (UTF-8). The responses still waiting in memory are written to the log first. The columns:
| Column | Content |
|---|---|
| Logged (UTC) | The time the response was recorded (ISO 8601, milliseconds). |
| Time Stamp Time (UTC) | The time in the time stamp; - for a refused request. |
| Response Code | Granted, Rejection, or 0 for a granted Authenticode response. |
| Response Message | OK, Authenticode, or the reason of the refusal. |
| Hash Algorithm | sha1, sha256, sha384, sha512 or sha224. |
| TSA Response Serial Number | The serial number in decimal; - when there is none. |
| TSA Certificate | The subject of the certificate that signed. |
| TSA Certificate Serial Number | Its serial number. |
| Username | The user, or -. |
| IP | The address of the client. |
13.6 Delete entries
The section Delete entries at the bottom of the page deletes entries of the log by month:
- Only month: the entries of that month;
- Up to month (inclusive): that month and every earlier month.
Choose the period, click Delete and confirm. Unlike the audit trail, the current month can be deleted as well; the new responses continue to be logged. The result is shown at the top of the page, for example "84,120 entries of October 2026 were deleted."
- The deletion cannot be undone. Export the entries that you must keep before deleting them.
- The deletion is recorded in the audit trail (Response log entries deleted).
- The database file returns the freed space to the disk gradually, in the background.
To stop logging, untick Log all responses and click Save: the entries already logged stay until they are older than the retention period, or until you delete them.
14. Status
The Status page of PKISimple TSA Server shows, in one place, everything that can stop the server from issuing time stamps: the license, the time stamp certificate, the clock, the database and its disk, the backups, the logs and the background work that writes them. It also shows the result of the tests that the server runs by itself every day.
Open it with Status in the menu bar. When something needs attention, the main page shows a red or yellow message with the link See the Status page (The main page and the navigation).

14.1 How to read the page
Each line has a sign, a title and a message:
| Sign | Meaning |
|---|---|
| ✓ (green) | Good. |
| ⚠ (yellow) | A warning: the server works, but something must be done soon. |
| ✗ (red) | An error: the server refuses time stamps, or a check failed. |
| – (grey) | Not used, or not tested. |
A warning or an error line ends with a link to the page where it is fixed (for example Backup and Restore → or Configuration →). The lines about the clock, the disk and the background work have no link: they are fixed on the machine, not in the pages.
Refresh (bottom bar) reads the state again.
14.2 Current State
The state is read when the page is shown; the time of the reading is in the text above the list. The page does not run the long checks here (the integrity of the whole database, the whole audit chain): it shows the result of the last ones.
| Line | Good | Warning or error, and what to do |
|---|---|---|
| License | "Licensed to customer", or the days and time stamps left of the trial. | Warning in the last 7 days or 500 time stamps of the trial; error when the trial stopped the time stamps. Register the license (Trial period and registration). |
| Time stamp certificate | The subject, the key and signature algorithms and the expiry date. A note when it is the certificate created by the server at the installation (self-signed: the clients must trust it). | Warning when it expires in less than 30 days: select or create another certificate before that date. Error when it is expired or not yet valid, cannot be used (the reason follows "The certificate cannot be used:"), or when the configuration is not valid; in each case "The server refuses every time stamp request." See The time stamp certificate and HSM, smart cards and USB tokens. Also an error before the installation is finished ("The server is not installed yet: …"). |
| Clock | The time of the server now (UTC), "Not marked as wrong by an external clock monitor." | Error while the file App_Data\settings\invalidtime.sys exists: "The clock is marked as desynchronized (…): the server refuses every time stamp request until the file is deleted." Correct the clock, then delete the file (Synchronize the clock). |
| Database | The database file, its size (with its write-ahead log), and "the integrity check passed when the application started" (and in the tests of a given time). For a large database: "the integrity check of the start still runs (a large database)". | Error when the integrity check failed (at the start, or in the last tests), or when the database cannot be read. The server refuses the time stamps until a backup is restored: restore the last good backup (Backup, restore, move and upgrade). |
| Storage | The free space on the disk of the data folder, and the size of the database. | Warning when less than 1 GB is free, or less than twice the size of the database. The database and its backups grow on this disk, and a full disk stops the logs: free some space, move the old backups away, or delete old log entries (Audit Trail, Time Stamp Responses). The line is missing when the free space cannot be read (for example on a network share). |
| Last backup | When the newest backup was made on the server or downloaded. | Warning when no backup was made yet, or the newest is older than 30 days: make one on the Backup and Restore page and keep a copy away from the server. The copies saved automatically before a restore do not count. |
| Response log | "Every response is logged; n written since the application started, none dropped." Grey "Not used" when Log all responses is off. | Warning when entries were dropped since the application started (the server issued more time stamps than the log could write; the time stamps were issued), or when writes of the log failed (the entries wait in memory and are written again; the last error follows). Check the disk and the database (Time Stamp Responses). |
| Audit trail | The number of entries. | Warning when events could not be written since the application started but the newer ones were written; error when the latest event could not be written: "The trail is not being written now: check the database and the disk." |
| Background work | "Runs every n s (last pass … ago, the longest … ms; the application started …)" (1 s by default, setting Tsa.FlushIntervalSeconds of Web.config). Just after a start: "The application has just started; …". | Warning when it has not run since the start, when its last pass is more than 30 seconds old (the counts and the logs wait in memory), or when it had errors (the last one follows). It stops when the application pool stops or hangs: check the application pool in IIS Manager and recycle it if needed. |
The Response log, Audit trail and Background work lines describe the worker process that answers the page. With several worker processes (a web garden) each has its own.
Source Edition: the License line shows "Registered Version": the Source Edition has no license and no trial period.
14.3 The tests
The tests do what a client would notice, and the checks that read the whole database:
| Test | What it does |
|---|---|
| Test time stamp | Tests the private key (a PKCS#11 device is asked again; a key in a PFX file or in the Windows store signs a test message), then issues a time stamp inside the server with the saved configuration and verifies it. Shows the time it took, the certificate and the time of the time stamp. |
| Audit trail | Checks the whole hash chain of the audit trail (Audit Trail). |
| Database integrity | The integrity check of the whole database file. On a database of tens of GB it can take minutes; it runs on its own thread and the server keeps working. |
| Public address | Only when the tests are run from the page: a real RFC 3161 request, without credentials, sent to get.aspx at the address of the page that you are using, as a client would send it (14.4). The daily tests cannot do it: the server does not know the address that its clients use, so the line is grey. |
When the tests run:
- by themselves, a minute after the application starts, then once a day (24 hours after the previous run);
- when you click Run the Tests Now. The result is shown at the top of the page: "The tests passed.", "The tests passed with warnings." or "Some tests failed: see below."
The line above the results says when they ran: "Last run … (…, automatic)" or "(…, run from this page)", and when the next automatic run is due. Before the first run: "The tests have not run yet (the server runs them a minute after the start, then once a day)."
If the configuration, the certificate or the database (a restore) changed after the last run, a yellow line says "The configuration changed after this run (…): the results below are from before the change. Run the tests again."
The result in the audit trail. Every run is recorded as the event Status tests (Audit Trail):
- the daily run as one short line, for example "Passed. Daily tests: 3 checks." or, when something is wrong, "Failed. Daily tests: 1 failed of 3 checks. Failed Database integrity: … (all the results: Status page)";
- a run from the page with every result.
The level of the event follows the result: information, a warning ("Passed with warnings") or an error ("Failed").
The test time stamps count. Each test time stamp counts as an issued time stamp: in the counter of the main page, in the 5,000 time stamps of the trial period, and, when Log all responses is on, in the response log, with the user internalTestOperation. One daily run uses one time stamp; a run from the page uses one more when the request to the public address receives a time stamp.
The main page warns when the last tests found problems or warnings, when the daily tests have not run an hour after the start, or when the last run is more than two days old ("… they have not run since (is the application pool running?)").
14.4 The public address test
This test sends a request from the server to the address of the Status page as you opened it, followed by get.aspx (for example https://tsa.example.com/tsa/get.aspx), and waits up to 10 seconds. The results:
| Result | Meaning and what to do |
|---|---|
| ✓ "…: a time stamp was issued in n ms, as a client gets it." | The address works. |
| ✓ "…: answered in n ms; authentication is required, so the request without credentials was refused, as expected (…)." | Require authentication is on: the refusal for missing credentials shows that the address answers. |
| ✗ "…: no time stamp response (…). The clients send their requests to this address." | The server could not reach the address, or got an HTTP error. Check the name and the port, the firewall, the HTTPS certificate of the site (the server itself must trust it), and that the server can reach its own public name. |
| ✗ "…: the answer is not a time stamp response (content type …)." | Something else answered at that address, for example a proxy, a login page or an error page of IIS. |
| ✗ "…: the time stamp was refused: …" | The address works, but the server refused the request: the reason follows (for example the trial period, the clock, the certificate). |
Open the Status page with the address that the clients use (not localhost) when you want to test that address.
15. Testing the server
PKISimple TSA Server can be tested in three ways, from the inside out:
| Test | Where | What it proves |
|---|---|---|
| Issue a Test Time Stamp | Configuration page | The certificate, its private key and the saved settings can issue a valid time stamp. |
| Time Stamp a File and Verify a Time Stamp | Tools menu | A time stamp of a real file, and the content and the validity of any time stamp file. |
| A request from another program | openssl and curl, or the client programs | The address get.aspx works through the network, IIS, HTTPS and the authentication, as the clients see it. |
The Run the Tests Now button of the Status page combines the first and the last: a test time stamp and a real request to the public address of the server.
Every time stamp issued by these tests counts as an issued time stamp: in the counter of the main page, in the 5,000 time stamps of the trial period (Trial period and registration) and, when Log all responses is on, in the response log, with the user internalTestOperation (except a request sent from another program, which is an ordinary client request).
15.1 Issue a Test Time Stamp
On the Configuration page, in the section of the time stamp certificate, click Issue a Test Time Stamp. Do it after the installation, after every change of the certificate, and after every change of the account of the application pool, of the rights on a key or of a hardware device.
The server:
- tests the private key: a key in a PFX file or in the Windows store signs a test message; a PKCS#11 device is found, logged in and asked again (a PIN refused before is sent again, so a corrected PIN is used);
- issues a time stamp inside the server, with the saved configuration, as the administrator: Require authentication and the quotas of the users do not apply;
- checks the response against the request and verifies the signature.
| Result | Meaning |
|---|---|
| "The test time stamp was issued and verified. Time (UTC): …" | The server can issue time stamps. The time is the time written in the test time stamp. |
| "Time stamping test error: …" | The cause follows: for example the certificate cannot be loaded, the key cannot be used by the account of the application pool, the PKCS#11 device or PIN, the trial period, the clock. See The time stamp certificate, HSM, smart cards and USB tokens and Problems and solutions. |
| "… Unsaved changes on this page were not used: save them first." (added to either message) | The form has changes that were not saved: the test used the saved settings. Click Save Configuration and test again. |
The test saves nothing. It does not go through the network, IIS or the address get.aspx: for that, use the Status page or a request from another program (15.4).
To test only the key of a certificate before using it, use Test the Certificate on the Select Certificate page (The time stamp certificate).
15.2 Time Stamp a File
Tools → Time Stamp a File time stamps a file of your computer.
- In File to time stamp, choose a file (up to about 4 MB).
- Click Time Stamp the File.
The server computes the SHA-256 hash of the file in memory (the file is not saved), creates an RFC 3161 request with a random nonce, the policy of the configuration and a request for the certificate, issues the time stamp, checks it against the request and verifies its signature. Like the test of the Configuration page, it does not apply Require authentication or the quotas.

The result:
| Field | Content |
|---|---|
| Response status | 0: granted (the PKIStatus of RFC 3161). |
| Signature | valid. |
| Time (UTC) | The time written in the time stamp. |
| Serial number | The serial number of the time stamp, in decimal (as on the Time Stamp Responses page). |
| Nonce | The random number of the request, repeated by the server. |
| Ordered | yes or no, as set in the configuration. |
| Message imprint algorithm | sha256. |
| Policy | The policy OID of the server. |
| Accuracy | When the configuration sets one. |
Download the Time Stamp File saves the response as Response.tsr, which you can open with Verify a Time Stamp or with openssl ts -reply.
If it fails, the page shows "An error has occurred: …" with the cause, and the error is recorded in the audit trail (Apply Timestamp page error). Without a file: "Select the file that you want to time stamp."
15.3 Verify a Time Stamp
Tools → Verify a Time Stamp reads a time stamp file and checks it.
- In Time stamp response file (.tsr), choose the file: a time stamp response (
.tsr), or a bare time stamp token. The file can be up to about 2 MB. - Optionally, in Original file (optional), choose the file that was time-stamped: its hash is compared with the message imprint of the time stamp.
- Click Verify.
The page checks, for a token that contains the TSA certificate:
| Line | Check |
|---|---|
| Signature | The signature of the token is correct: the token was not changed. |
| TSA certificate binding (ESSCertID) | The signing certificate attribute of the token identifies the certificate that signed. |
| TSA certificate usage | The certificate has the critical extended key usage Time Stamping, and only that. |
| TSA certificate at the time of the token | The time of the token is within the validity of the certificate. |
| Original file | Only with the original file: its hash matches the message imprint. |
Then it shows the content of the token: the response status (with the response message, if any), the time, the serial number (decimal), the nonce, ordering, the message imprint algorithm, the policy, the accuracy, the signature hash algorithm (and, for a post-quantum certificate, the ML-DSA signature algorithm), the extensions (a qualified time stamp is named as such) and the subject of the TSA certificate. Download the TSA Certificate saves the certificate of the token as TSACertificate.cer.

The summary at the top:
| Summary | Meaning |
|---|---|
| Green: "The time stamp is valid for the original file. The trust of the TSA certificate chain is checked by the client." | Every check passed, and the original file matches. |
| Yellow: "No error was found, but the time stamp could not be verified completely: …" | Something could not be checked: no original file was given (so the token was not compared with a document), the token does not contain the TSA certificate (request the time stamps with the certificate, certReq), or the hash algorithm of the token is not known. |
| Red: "The time stamp is not valid: …" | A check failed: the signature, the binding of the certificate, its usage, its validity at the time of the token, or the original file does not belong to the token. |
What the page does not check: whether the TSA certificate is trusted (its chain up to a trusted root) and whether it was revoked. That is the job of the program that relies on the time stamp (Using the server with applications).
A file that is not a time stamp gives "The file cannot be read as a time stamp response or token: …" and the error is recorded in the audit trail (Verify page error). A response that holds a refusal shows its status (for example 2, rejection) and the response message, and no token.
15.4 Test from the command line (OpenSSL and curl)
A request from another computer tests the server as a client sees it: the name and the port, the firewall, HTTPS, IIS and the authentication. OpenSSL and curl are enough. On Windows, curl.exe is included in Windows 10 and later; in Windows PowerShell type curl.exe, because curl alone is another command there.
Replace https://tsa.example.com/tsa/get.aspx with the address shown on the main page of your server.
1. Check that the application answers. Open the address in a browser (a request without data). The server answers with the text "PKISimple TSA Server: RFC 3161 and Authenticode time stamp server".
2. Create a request for a file (its SHA-256 hash, with a nonce, asking for the certificate in the response):
openssl ts -query -data invoice-0001.txt -sha256 -cert -out request.tsq3. Send it with the content type application/timestamp-query:
curl -s -H "Content-Type: application/timestamp-query" --data-binary @request.tsq -o response.tsr https://tsa.example.com/tsa/get.aspxWhen Require authentication is on, add the credentials of a user with -u user:password (HTTP Basic authentication), or put them in the address (get.aspx?u=user&p=password); see Users and authentication.
4. Read the response:
openssl ts -reply -in response.tsr -textA granted time stamp starts with:
Status info:
Status: Granted.followed by the TST info: the policy, the hash algorithm, the serial number (in hexadecimal), the time, the nonce and the name of the TSA.
5. Verify the response against the request and the TSA certificate. Download the certificate with Tools → Download the Time Stamp Certificate (TSACertificate.crt, DER format), convert it, and check:
openssl x509 -inform der -in TSACertificate.crt -out tsa.pem
openssl ts -verify -in response.tsr -queryfile request.tsq -CAfile tsa.pemThe answer Verification: OK means that the time stamp matches the request and was signed by that certificate. To check against the file instead of the request, use -data invoice-0001.txt in place of -queryfile request.tsq. For a certificate issued by a certification authority, -CAfile must contain the root certificate of the authority, and -untrusted the intermediate certificates.
What the results mean:
| Result | Meaning and what to do |
|---|---|
Status: Granted. and Verification: OK | The server works through the network. |
Status: Rejected. with a Status description | The server refused the request; the description gives the reason. For example "Invalid credentials to login to the TSA server." (missing or wrong user name or password), "User is not active.", "Not enough time stamp requests." (the quota of the user), "Too many failed authentication attempts. Try again later.", "TSA time is desynchronized." (the clock is marked as wrong), a policy or nonce requirement of the configuration. A server error is described to the client only as "TSA Response error.": the cause is in the Audit Trail. The refusal is also on the Time Stamp Responses page. |
openssl ts -reply cannot read response.tsr | The server did not send a time stamp response. Look at the file as text, or run curl with -i to see the HTTP status: for example HTTP 400 "Invalid request: the body is not an RFC 3161 or Authenticode time stamp request." (the request file is not a time stamp request), an HTML error page of IIS, or a login page of a proxy. |
| curl cannot connect | The name, the port, the firewall, or the HTTPS certificate of the site (curl must trust it). |
openssl ts -verify fails | The TSA certificate given in -CAfile is not the certificate that signed (for example the certificate was changed after the download), or the certificates of the authority are missing. |
Authenticode time stamps are tested with the signing tools of Windows, for example signtool sign /t (Using the server with applications).
15.5 Test as a client with Time Stamp Client
Time Stamp Client (folder Utils of the package) does what a client application does: it sends requests over the network and checks the answers in detail. Run it on a client computer to see what the clients see:
- it tests the whole path: the name and the port, the firewall, the HTTPS certificate, the user name and the password, the policy;
- it shows the status and the text of a refusal, and for a time stamp its time, nonce, signature, certificate chain and the revocation of the certificate;
- its verifier checks a
.tsrfile against the original file and tells whether the computer trusts the certificate of the server; - it can send many requests in parallel and measure the throughput of the server. Do not send a large number of requests to a server that is not yours.
Its manual is at https://tsaserver.com/manual/time-stamp-client.
16. Using the server with applications
This chapter shows how to set up the common signing programs to ask PKISimple TSA Server for time stamps: Adobe Acrobat and Reader, the Windows code signing tools, Java jarsigner and Microsoft Office. For your own programs and scripts, see Integration guides.
The address. Every program uses the address that the main page shows as Time Stamp Address, for example https://tsa.example.com/tsa/get.aspx. The same address answers RFC 3161 requests and the older Authenticode requests; the server recognizes the protocol from the request. Opened in a browser, the address shows only the line PKISimple TSA Server: RFC 3161 and Authenticode time stamp server: this is normal, a browser sends no time stamp request.
Try the client first. To learn how a program asks for a time stamp, test it with your new installation, which works at once with the certificate that it created at the installation; later you change only the certificate. Look at the result in Time Stamp Responses and in the Audit Trail (the reason of every refused request is there). Until the certificate is installed on the computer of the verifier, the program reports the time stamp as unverified (section 16.1). See Testing the server.
16.1 Make the time stamp certificate trusted
A program that verifies a time stamp checks the certificate that signed it. If that certificate is not trusted on the computer of the verifier, the program reports the time stamp as unverified or not trusted (not as invalid).
- The certificate that the server creates at the installation (CN=Local TSA Server, or the test certificate of the Source Edition) and the certificates made with Create New Certificate are self-signed: each one is its own root and must be installed as a trusted root on the computers of the verifiers.
- A certificate issued by a certification authority is trusted when the root of the authority is trusted. Install the certificate of the authority, not the time stamp certificate.
To install the self-signed certificate on a Windows computer:
- On the server, open Tools → Download the Time Stamp Certificate (also in the Tools section of the main page), or send the file
TSACertificate.crtto the verifier. - Right-click the file and select Install Certificate.
- Select Current User for one user, or Local Machine for all the users of the computer.
- Select Place all certificates in the following store, press Browse and select Trusted Root Certification Authorities.
- Windows asks you to confirm. Press Yes only if you know the certificate: Windows then trusts every certificate that it signs.



To install it on many computers at once, use a Group Policy of the domain (Public Key Policies → Trusted Root Certification Authorities).
The labels in this section belong to Windows, not to the server; they can differ slightly between Windows versions.
16.2 Credentials when authentication is on
When Require authentication is on (Configuration page), every request must carry the user name and password of an enabled user. A client sends them in one of two ways (details in Users and client authentication):
| Way | When to use it |
|---|---|
HTTP Basic authentication (header Authorization: Basic) | The program has a user name and password setting for the time stamp server. Recommended. |
In the address: https://tsa.example.com/tsa/get.aspx?u=user&p=password | The program accepts only an address (signtool, jarsigner, PowerShell, the Office registry settings). |
After Add User, or after a password is changed, the Users page shows the complete address with the credentials of that user, already percent-encoded, with a Copy button. Characters such as &, +, #, % and space must be percent-encoded in an address you type yourself. Use HTTPS: both ways send the password readable over HTTP.
16.3 Adobe Acrobat and Adobe Reader
- Open Edit → Preferences → Signatures, and in Document Timestamping press More. (In older versions: Edit → Protection → Security Settings.)
- Select Time Stamp Servers and press New.
- Type a name and the address of the server.
- If the server requires authentication, tick This server requires me to log on and enter the user name and the password. If that does not work in your version, leave it unticked and use the address with
?u=…&p=…. - Set the new server as the default, so that the signatures are time stamped.
If the time stamp certificate (or its root) is neither in the trusted certificates of Adobe nor, when Adobe is set to use it, in the Windows store, Adobe shows the time stamp as not verified. Install the certificate as in section 16.1, or add it to the trusted certificates of Adobe.
The menu names come from Adobe and change between versions. Adobe Acrobat was not tested with version 7.6: test a signature and check Time Stamp Responses before you rely on it. The server refuses a request that carries any extension (see Problems and solutions).
16.4 Windows code signing (signtool, Authenticode)
signtool asks for an RFC 3161 time stamp with /tr (and /td for its hash algorithm), or for the older Authenticode time stamp with /t. The server answers both at the same address. Use /tr for new signatures.
signtool sign /f certificate.pfx /p password /fd SHA256 /tr https://tsa.example.com/tsa/get.aspx /td SHA256 program.exe
signtool sign /f certificate.pfx /p password /fd SHA256 /t https://tsa.example.com/tsa/get.aspx program.exeWith authentication, put the credentials in the address and quote it:
signtool sign /fd SHA256 /tr "https://tsa.example.com/tsa/get.aspx?u=user&p=password" /td SHA256 program.exeTo check the signature and its time stamp: signtool verify /pa /v program.exe.
Notes:
signtool /trnever sends a nonce. With Time Stamp Request must include a nonce ticked on the Configuration page, every/trrequest is refused.- An Authenticode response is sent Base64-encoded unless Do not encode Authenticode responses as BASE64 is ticked.
signtool /texpects the Base64 form: leave the option unticked unless a client needs the binary form. - An Authenticode refusal has no time stamp format: the client gets an HTTP error (403 for credentials and quota, 503 for the clock, the trial period or a server not installed yet, 500 when the server cannot sign, for example a certificate or a key that cannot be used, 400 for a malformed request). The cause of a 500 is in the Audit Trail.
PowerShell scripts. Set-AuthenticodeSignature time stamps the signature of a script:
$cert = Get-PfxCertificate d:\cert.pfx
Set-AuthenticodeSignature -FilePath d:\script.ps1 -Certificate $cert -IncludeChain All -TimeStampServer "https://tsa.example.com/tsa/get.aspx"(Get-AuthenticodeSignature d:\script.ps1).TimeStamperCertificate then shows the certificate of your server. The command has no setting for the credentials of the time stamp server: with authentication, use the address with ?u=…&p=….
Office macros (VBA). Microsoft Office signs VBA projects without a time stamp by default. To time stamp them, add the address of the server to the registry of the user who signs:
reg add "HKCU\Software\Microsoft\VBA\Security" /v "TimeStampURL" /f /d "https://tsa.example.com/tsa/get.aspx"
reg add "HKCU\Software\Microsoft\VBA\Security" /v "TimeStampRetryCount" /f /t REG_DWORD /d 2
reg add "HKCU\Software\Microsoft\VBA\Security" /v "TimeStampRetryDelay" /f /t REG_DWORD /d 116.5 Java (jarsigner)
jarsigner -keystore "d:\keystore.key" -storepass <keystore password> -tsa https://tsa.example.com/tsa/get.aspx "d:\lib.jar" <key alias>
jarsigner -verify -verbose "d:\lib.jar"jarsignerof Java 21 sends an RFC 3161 request with SHA-384 and a nonce; the server accepts it with its default settings.- Do not select SHA-1 (legacy, not recommended) as Time Stamp Response Hash Algorithm:
jarsignermarks a time stamp signed with SHA-1 as disabled. The Configuration page warns when you save SHA-1. jarsignersends no user name: with authentication, use the address with?u=…&p=…(quote it in the command).jarsigner -verifyreports a time stamp whose certificate is not trusted by Java. Import the root into the trust store of Java (keytool -importcert) on the computers that verify.
16.6 Signatures of Microsoft Office documents (XAdES-T)
Microsoft Office signs documents with XAdES signatures. To add a time stamp (XAdES-T), set these values in the registry of the user. The key contains the version of Office: 14.0 for Office 2010, 15.0 for Office 2013, 16.0 for Office 2016 and later.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Signatures]
"XAdESLevel"=dword:00000002
"MinXAdESLevel"=dword:00000001
"TSALocation"="https://tsa.example.com/tsa/get.aspx"XAdESLevel2 asks for XAdES-T.MinXAdESLevelis the minimum level that must be reached: with 1, Office signs without a time stamp (XAdES-EPES) when the server cannot be reached; with 2 it shows an error instead.- Office requires the time stamp certificate to be trusted (section 16.1); otherwise it warns when the signature is applied.
- With authentication, put the address with
?u=…&p=…inTSALocation.
16.7 Other programs
Any program that uses RFC 3161 over HTTP works: it sends the request with an HTTP POST and the content type application/timestamp-query, and receives application/timestamp-reply. A refused request also receives application/timestamp-reply (with HTTP 200): an RFC 3161 response with the status rejection and a text that says why.
The options of a client correspond to the settings of the server (Server settings):
| Option of the client | Setting of the server |
|---|---|
| Hash algorithm of the request | Accepted: SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 and SHA3-224 to SHA3-512. Other algorithms (MD5, for example) are refused. The signature of the response follows Time Stamp Response Hash Algorithm (by default the algorithm of the request, at least SHA-256). |
| Send a nonce | Time Stamp Request must include a nonce (off by default). When the request has a nonce, the server always copies it into the time stamp. |
| Policy OID | Time Stamp Server Policy ID (default 1.3.6.1.4.1.1.2.1.2). A request that names another policy is always refused; Time Stamp Request must include the current Time Stamp Server Policy ID also refuses a request without a policy. |
| Ask for the certificate in the response (certReq) | The server includes its certificate when the request asks for it; Include whole chain on the Time Stamp Response adds the chain. Ask for it, so the time stamp can be verified offline. |
| Request extensions | Not accepted: a request with any extension is refused (unacceptedExtension). |
| User name and password | Require authentication and the users (chapter 11). |
If you are a developer, Integration guides has complete examples for OpenSSL, PowerShell, C#, Java, Python and PHP, and for long-term signatures with the Signature Library.
17. Integration guides
This chapter is for developers and administrators who request time stamps from PKISimple TSA Server in their own programs and scripts. Each guide is a short, complete example for one tool or one programming language: copy the code, put the address of your server in it and run it.
The same three steps in every guide
- Compute the hash and build the request. The program computes the SHA-256 hash of the file and puts it in an RFC 3161 time stamp request. The file never leaves your computer.
- Send the request to the server. An HTTP
POSTto the Time Stamp Address of the main page, with the content typeapplication/timestamp-query. The server answers with the content typeapplication/timestamp-reply; the answer is saved as a.tsrfile. - Verify the time stamp. The program checks the time stamp against the original file and reads its time (UTC).
What the server expects from a request:
- Hash algorithm: SHA-256 (used in every example), SHA-384, SHA-512, SHA-224, SHA-1 or SHA3. MD5 and the other algorithms are refused.
- No extensions: a request that carries any extension is refused.
- Nonce and policy: optional, unless the Configuration page requires them (Time Stamp Request must include a nonce, Time Stamp Request must include the current Time Stamp Server Policy ID). A request that names a policy other than Time Stamp Server Policy ID is always refused.
- A refusal is also an RFC 3161 response: HTTP 200, content type
application/timestamp-reply, with the status rejection and a text that says why (for exampleInvalid credentials to login to the TSA server.). Check the status of every response, not only the HTTP status. The reason is also written to the Audit Trail.
Before you run the examples
- The address. The examples use
https://tsa.example.com/tsa/get.aspx. Replace it with the Time Stamp Address that the main page of your server shows. - Authentication. If Require authentication is on (chapter 11), the simplest way is to put the credentials in the address:
https://tsa.example.com/tsa/get.aspx?u=user&p=password(percent-encode special characters). The code does not change. Clients that can set an HTTP header should send HTTP Basic authentication instead, which keeps the password out of the address and of the logs:Example Add this for Basic authentication curl -u user:passwordPowerShell 7 -Headers @{ Authorization = "Basic " + [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("user:password")) }onInvoke-WebRequestC# client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes("user:password")));Java conn.setRequestProperty("Authorization", "Basic " + Base64.getEncoder().encodeToString("user:password".getBytes(StandardCharsets.UTF_8)));PHP curl_setopt($ch, CURLOPT_USERPWD, "user:password");SignLib TimeStamping.UserNameandTimeStamping.PasswordUse HTTPS: over HTTP both ways send the password readable.
- The certificate for the verification. The examples that check the certificate use the file
tsa.pem, the certificate of your server. Download it with Tools → Download the Time Stamp Certificate (the fileTSACertificate.crt, DER-encoded) and convert it, as in Testing the server:openssl x509 -inform der -in TSACertificate.crt -out tsa.pem. For a time stamp certificate issued by a certification authority,tsa.pemmust also contain the certificates of the authority.
17.1 OpenSSL and curl (command line)
The quickest way to request and verify a time stamp for any file, from a terminal on Windows, Linux or macOS. Needs: the openssl and curl programs.
Step 1: build the request (.tsq). OpenSSL computes the hash of the file and creates the request (with a nonce). The option -cert asks the server to include its certificate in the response, so that the time stamp can be verified offline.
openssl ts -query -data document.pdf -sha256 -cert -out request.tsqStep 2: send it to the server. The content type must be application/timestamp-query, and the file must be sent unchanged with --data-binary (not -d, which changes binary data). The answer is saved in response.tsr.
curl -H "Content-Type: application/timestamp-query" \
--data-binary "@request.tsq" \
https://tsa.example.com/tsa/get.aspx \
-o response.tsrStep 3: verify the time stamp (.tsr). OpenSSL checks the time stamp against the original file and the certificate of the server.
openssl ts -verify -data document.pdf \
-in response.tsr \
-CAfile tsa.pemWhen the time stamp is valid and the file is intact, OpenSSL writes Verification: OK.
Optional: read the time stamp. This shows the status, the time (UTC), the hash algorithm, the serial number and the name of the server. For a refused request it shows the status Rejected and the text of the server.
openssl ts -reply -in response.tsr -text17.2 PowerShell
Request and verify RFC 3161 time stamps from PowerShell 7 with the .NET classes, without any other program. It fits scripts, deployment tasks and CI/CD pipelines. Needs: PowerShell 7.2 or later (SHA256.HashData needs .NET 5 or later); it uses System.Security.Cryptography.Pkcs, which PowerShell 7 includes. Windows PowerShell 5.1 does not have these classes: use the OpenSSL commands of section 17.1 there.
Step 1: request the time stamp. The function computes the SHA-256 hash of the file, builds an Rfc3161TimestampRequest, sends it with Invoke-WebRequest, writes the answer to disk and checks it.
function Request-Rfc3161Timestamp {
param (
[Parameter(Mandatory = $true)]
[string]$FilePath,
[Parameter(Mandatory = $true)]
[string]$OutputTsrPath,
[Parameter(Mandatory = $true)]
[string]$TsaUrl
)
# 1. Compute SHA-256 hash of the target file
# (.NET resolves relative paths from the process directory, not from the PowerShell location: use full paths)
$fileBytes = [System.IO.File]::ReadAllBytes((Convert-Path -LiteralPath $FilePath))
$hash = [System.Security.Cryptography.SHA256]::HashData($fileBytes)
# 2. Build RFC 3161 request: no policy, no nonce, request the TSA certificate, no extensions
$request = [System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest]::CreateFromHash(
$hash,
[System.Security.Cryptography.HashAlgorithmName]::SHA256,
$null, # requested policy
$null, # nonce
$true, # request the TSA certificate in the response
$null # extensions
)
# 3. Send HTTP POST request to the TSA endpoint and save the response (.tsr)
Invoke-WebRequest -Uri $TsaUrl `
-Method Post `
-ContentType "application/timestamp-query" `
-Body $request.Encode() `
-OutFile $OutputTsrPath
# 4. Check the response: granted, and a time stamp of this hash (throws an exception otherwise)
$bytesRead = 0
$token = $request.ProcessResponse([System.IO.File]::ReadAllBytes((Convert-Path -LiteralPath $OutputTsrPath)), [ref]$bytesRead)
Write-Host "[SUCCESS] Timestamp saved to: $OutputTsrPath (UTC $($token.TokenInfo.Timestamp.UtcDateTime))" -ForegroundColor Green
}Step 2: verify the time stamp. The function builds the same request again (without a nonce it is identical), which checks that the .tsr is a granted time stamp of the hash of the original file, then checks the signature of the time stamp.
function Test-Rfc3161Timestamp {
param (
[Parameter(Mandatory = $true)]
[string]$FilePath,
[Parameter(Mandatory = $true)]
[string]$TsrPath
)
# 1. Read original file and compute SHA-256 hash
$fileBytes = [System.IO.File]::ReadAllBytes((Convert-Path -LiteralPath $FilePath))
$hash = [System.Security.Cryptography.SHA256]::HashData($fileBytes)
$tsrBytes = [System.IO.File]::ReadAllBytes((Convert-Path -LiteralPath $TsrPath))
# 2. Read the response and check that it is a time stamp of this hash
$request = [System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest]::CreateFromHash(
$hash, [System.Security.Cryptography.HashAlgorithmName]::SHA256, $null, $null, $true, $null)
$bytesRead = 0
try {
$token = $request.ProcessResponse($tsrBytes, [ref]$bytesRead)
} catch {
Write-Error "[ERROR] Not a granted time stamp of this file: $($_.Exception.Message)"
return $false
}
# 3. Check the signature of the time stamp (the trust of the certificate is not checked here)
try {
$token.AsSignedCms().CheckSignature($true)
} catch {
Write-Error "[ERROR] Invalid timestamp signature: $($_.Exception.Message)"
return $false
}
Write-Host "[SUCCESS] Timestamp is valid! Signed at (UTC): $($token.TokenInfo.Timestamp.UtcDateTime)" -ForegroundColor Green
return $true
}Run it:
$fileToSign = "document.pdf"
$tsrOutput = "document.pdf.tsr"
$tsaUrl = "https://tsa.example.com/tsa/get.aspx"
# 1. Request Timestamp Token
Request-Rfc3161Timestamp -FilePath $fileToSign -OutputTsrPath $tsrOutput -TsaUrl $tsaUrl
# 2. Verify Timestamp Token
$isValid = Test-Rfc3161Timestamp -FilePath $fileToSign -TsrPath $tsrOutput
Write-Host "Verification Result: $isValid"17.3 C# .NET (native classes)
Since .NET Core 3.0 the namespace System.Security.Cryptography.Pkcs supports RFC 3161 directly. It is not part of the base framework of a console application: add the Microsoft package System.Security.Cryptography.Pkcs to the project (dotnet add package System.Security.Cryptography.Pkcs). Needs: .NET 5 or later (for SHA256.HashData). The example was run as it is, in a console application of .NET 10 with that package, against PKISimple TSA Server 7.6.
Step 1: request the time stamp. The method computes the SHA-256 hash of the file, builds an Rfc3161TimestampRequest, sends it with an HTTP POST and the content type application/timestamp-query, and checks the response with ProcessResponse before saving it.
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Threading.Tasks;
public class TimestampClient
{
public static async Task RequestTimestampAsync(string filePath, string outputTsrPath, string tsaUrl)
{
// 1. Compute SHA-256 hash of the target file
byte[] fileBytes = await File.ReadAllBytesAsync(filePath);
byte[] hash = SHA256.HashData(fileBytes);
// 2. Build RFC 3161 timestamp request
Rfc3161TimestampRequest request = Rfc3161TimestampRequest.CreateFromHash(
hash,
HashAlgorithmName.SHA256,
requestSignerCertificates: true
);
// 3. Send HTTP POST request to the TSA server
using HttpClient client = new HttpClient();
ByteArrayContent content = new ByteArrayContent(request.Encode());
content.Headers.ContentType = new MediaTypeHeaderValue("application/timestamp-query");
HttpResponseMessage response = await client.PostAsync(tsaUrl, content);
response.EnsureSuccessStatusCode();
byte[] tsrBytes = await response.Content.ReadAsByteArrayAsync();
// 4. Check the response: granted, and a time stamp of this hash (throws CryptographicException otherwise)
Rfc3161TimestampToken token = request.ProcessResponse(tsrBytes, out _);
// 5. Save timestamp response (.tsr)
await File.WriteAllBytesAsync(outputTsrPath, tsrBytes);
Console.WriteLine($"[SUCCESS] Timestamp saved to: {outputTsrPath} (UTC {token.TokenInfo.Timestamp.UtcDateTime})");
}
}Step 2: verify the time stamp. The method reads the .tsr with the same request (without a nonce it is identical), then verifies the signature of the time stamp, the hash of the file and the link to the TSA certificate.
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
public class TimestampVerifier
{
public static bool VerifyTimestamp(string filePath, string tsrPath)
{
byte[] hash = SHA256.HashData(File.ReadAllBytes(filePath));
byte[] tsrBytes = File.ReadAllBytes(tsrPath);
// Read the RFC 3161 response: status granted and a time stamp of this hash
Rfc3161TimestampRequest request = Rfc3161TimestampRequest.CreateFromHash(
hash, HashAlgorithmName.SHA256, requestSignerCertificates: true);
Rfc3161TimestampToken token;
try
{
token = request.ProcessResponse(tsrBytes, out _);
}
catch (CryptographicException ex)
{
Console.WriteLine($"[ERROR] Not a granted time stamp of this file: {ex.Message}");
return false;
}
// Verify the signature and the hash (the trust of the certificate is not checked here)
if (token.VerifySignatureForHash(hash, HashAlgorithmName.SHA256, out X509Certificate2 signer))
{
Console.WriteLine($"[SUCCESS] Timestamp is valid! Signed at (UTC): {token.TokenInfo.Timestamp.UtcDateTime} by {signer.Subject}");
return true;
}
Console.WriteLine("[ERROR] Hash mismatch or invalid signature.");
return false;
}
}Run the whole workflow in a console application:
string fileToSign = "document.pdf";
string tsrOutput = "document.pdf.tsr";
string tsaServerUrl = "https://tsa.example.com/tsa/get.aspx";
// 1. Request Timestamp
await TimestampClient.RequestTimestampAsync(fileToSign, tsrOutput, tsaServerUrl);
// 2. Verify Timestamp
bool isValid = TimestampVerifier.VerifyTimestamp(fileToSign, tsrOutput);
Console.WriteLine($"Verification Result: {isValid}");A time stamp signed with an ML-DSA certificate (post-quantum) can be verified only by a .NET version that supports ML-DSA; see The time stamp certificate.
17.4 Java (BouncyCastle)
Request and verify time stamps in Java with the BouncyCastle library. Needs: Java 9 or later and the BouncyCastle PKIX library.
Prerequisite. Add the BouncyCastle library to your pom.xml (Maven) or build.gradle:
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.78.1</version>
</dependency>Step 1: request the time stamp. The method computes the SHA-256 hash of the file, builds a TimeStampRequest with a nonce, sends it with an HTTP POST and the media type application/timestamp-query, and validates the response against the request before saving it.
import org.bouncycastle.tsp.*;
import java.io.*;
import java.math.BigInteger;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.file.Files;
import java.security.MessageDigest;
import java.security.SecureRandom;
public class JavaTimestampClient {
public static void requestTimestamp(String filePath, String outputTsrPath, String tsaUrl) throws Exception {
// 1. Compute SHA-256 hash of the target file
byte[] fileBytes = Files.readAllBytes(new File(filePath).toPath());
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest(fileBytes);
// 2. Build RFC 3161 TimeStampRequest
TimeStampRequestGenerator requestGenerator = new TimeStampRequestGenerator();
requestGenerator.setCertReq(true); // Request TSA certificate in response
BigInteger nonce = new BigInteger(64, new SecureRandom());
TimeStampRequest request = requestGenerator.generate(TSPAlgorithms.SHA256, hash, nonce);
byte[] requestBytes = request.getEncoded();
// 3. Send HTTP POST request to TSA Server
URL url = new URL(tsaUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/timestamp-query");
try (OutputStream os = conn.getOutputStream()) {
os.write(requestBytes);
os.flush();
}
if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
throw new IOException("TSA Server responded with HTTP " + conn.getResponseCode());
}
byte[] tsrBytes;
try (InputStream is = conn.getInputStream()) {
tsrBytes = is.readAllBytes();
}
// 4. Check the response: a time stamp was issued, for this hash and this nonce
TimeStampResponse response = new TimeStampResponse(tsrBytes);
if (response.getTimeStampToken() == null) {
throw new IOException("The time stamp was refused: " + response.getStatusString());
}
response.validate(request);
// 5. Save response (.tsr) to disk
Files.write(new File(outputTsrPath).toPath(), tsrBytes);
System.out.println("[SUCCESS] Timestamp saved to: " + outputTsrPath);
}
}Step 2: verify the time stamp. The method reads the .tsr file as a TimeStampResponse and compares the hash that it contains with the SHA-256 hash of the original file.
import org.bouncycastle.tsp.*;
import java.io.File;
import java.nio.file.Files;
import java.security.MessageDigest;
import java.util.Date;
public class JavaTimestampVerifier {
public static boolean verifyTimestamp(String filePath, String tsrPath) throws Exception {
// 1. Calculate SHA-256 hash of original file
byte[] fileBytes = Files.readAllBytes(new File(filePath).toPath());
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest(fileBytes);
// 2. Load TSR response
byte[] tsrBytes = Files.readAllBytes(new File(tsrPath).toPath());
TimeStampResponse response = new TimeStampResponse(tsrBytes);
TimeStampToken token = response.getTimeStampToken();
if (token == null) {
System.err.println("[ERROR] No timestamp token found in response: " + response.getStatusString());
return false;
}
// 3. Verify message imprint (hash matching)
TimeStampTokenInfo info = token.getTimeStampInfo();
byte[] tokenHash = info.getMessageImprintDigest();
if (MessageDigest.isEqual(hash, tokenHash)) {
Date signingTime = info.getGenTime();
System.out.println("[SUCCESS] The time stamp matches the file. Time (UTC): " + signingTime.toInstant());
return true;
} else {
System.err.println("[ERROR] File hash does not match timestamp imprint.");
return false;
}
}
}This step checks that the time stamp belongs to the file; it does not check the signature of the time stamp. To check the signature as well, verify the .tsr with OpenSSL (section 17.1, step 3), or validate the token with the certificate of the server in your BouncyCastle code.
Run it from your application:
public class Main {
public static void main(String[] args) {
try {
String fileToSign = "document.pdf";
String tsrOutput = "document.pdf.tsr";
String tsaUrl = "https://tsa.example.com/tsa/get.aspx";
// 1. Request Timestamp
JavaTimestampClient.requestTimestamp(fileToSign, tsrOutput, tsaUrl);
// 2. Verify Timestamp
boolean isValid = JavaTimestampVerifier.verifyTimestamp(fileToSign, tsrOutput);
System.out.println("Verification Result: " + isValid);
} catch (Exception e) {
e.printStackTrace();
}
}
}Keep setCertReq(true): with it the server returns its certificate inside the time stamp, so that the time stamp can be verified offline.
17.5 Python (rfc3161ng)
Request, save and verify time stamps in Python with rfc3161ng, a library built on pyasn1 and cryptography that hides the ASN.1 and the HTTP details. Needs: Python and the rfc3161ng package, and the certificate of the server (tsa.pem), which the library uses to check every time stamp.
Prerequisite. Install the library:
pip install rfc3161ngStep 1: request and save the time stamp. The function reads the file, asks the server for a time stamp of its SHA-256 hash, checks the answer with the certificate of the server and writes the time stamp token to disk. The library returns the token (the signed part of the response), so the file is saved as .tst, not .tsr.
import rfc3161ng
def request_timestamp(file_path: str, output_tst_path: str, tsa_url: str, cert_path: str):
# 1. Read target file and the certificate of the server
with open(file_path, "rb") as f:
file_data = f.read()
with open(cert_path, "rb") as f:
certificate = f.read()
# 2. Request an RFC 3161 time stamp of the SHA-256 hash; the response is checked
rt = rfc3161ng.RemoteTimestamper(tsa_url, certificate=certificate, hashname="sha256")
tst = rt.timestamp(data=file_data)
# 3. Save the time stamp token to disk
with open(output_tst_path, "wb") as f:
f.write(tst)
print(f"[SUCCESS] Timestamp saved to: {output_tst_path}")Step 2: verify the time stamp. The function checks the saved token against the original file and the certificate of the server, and reads its time.
import rfc3161ng
def verify_timestamp(file_path: str, tst_path: str, cert_path: str) -> bool:
with open(file_path, "rb") as f:
file_data = f.read()
with open(tst_path, "rb") as f:
tst = f.read()
with open(cert_path, "rb") as f:
certificate = f.read()
try:
rfc3161ng.check_timestamp(tst, certificate=certificate, data=file_data, hashname="sha256")
except Exception as e:
print(f"[ERROR] Invalid timestamp or hash mismatch: {e}")
return False
print(f"[SUCCESS] Timestamp is valid! Signed at (UTC): {rfc3161ng.get_timestamp(tst)}")
return TrueRun the whole workflow in a script:
if __name__ == "__main__":
file_to_sign = "document.pdf"
tst_output = "document.pdf.tst"
tsa_server_url = "https://tsa.example.com/tsa/get.aspx"
tsa_certificate = "tsa.pem"
# 1. Request Timestamp
request_timestamp(file_to_sign, tst_output, tsa_server_url, tsa_certificate)
# 2. Verify Timestamp
is_valid = verify_timestamp(file_to_sign, tst_output, tsa_certificate)
print(f"Verification Result: {is_valid}")OpenSSL verifies such a token with -token_in: openssl ts -verify -data document.pdf -in document.pdf.tst -token_in -CAfile tsa.pem.
17.6 PHP (cURL and OpenSSL)
Add time stamps to a PHP application: a web application, an e-invoicing system or a PDF pipeline. The script builds the request with OpenSSL and sends it with cURL. Needs: PHP 7.4 or PHP 8 with the curl extension, and the openssl program for the request and the verification.
Step 1: request the time stamp. The function creates the RFC 3161 request with OpenSSL, sends the binary request with cURL and saves the answer.
<?php
function requestTimestamp($filePath, $outputTsrPath, $tsaUrl) {
$tsqPath = $filePath . ".tsq";
// 1. Generate RFC 3161 timestamp query using OpenSSL
$cmd = "openssl ts -query -data " . escapeshellarg($filePath) . " -sha256 -cert -out " . escapeshellarg($tsqPath);
exec($cmd, $output, $returnCode);
if ($returnCode !== 0) {
throw new Exception("Failed to generate OpenSSL timestamp query.");
}
// 2. Send binary query via cURL
$tsqData = file_get_contents($tsqPath);
$ch = curl_init($tsaUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $tsqData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/timestamp-query"
]);
$tsrData = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// Clean up temporary query file
unlink($tsqPath);
if ($httpCode === 200 && $tsrData) {
file_put_contents($outputTsrPath, $tsrData);
echo "[SUCCESS] Timestamp response saved to: {$outputTsrPath}\n";
return true;
}
throw new Exception("TSA Server responded with HTTP code: {$httpCode}");
}HTTP 200 also comes with a refusal (an RFC 3161 response with the status rejection): step 2 reports it, and openssl ts -reply -in <file> -text shows the reason.
Step 2: verify the time stamp. The function checks the .tsr against the original document with OpenSSL, using the certificate of the server.
function verifyTimestamp($filePath, $tsrPath, $caChainPath) {
$cmd = "openssl ts -verify -data " . escapeshellarg($filePath) .
" -in " . escapeshellarg($tsrPath) .
" -CAfile " . escapeshellarg($caChainPath);
exec($cmd, $output, $returnCode);
if ($returnCode === 0) {
echo "[SUCCESS] Timestamp is valid!\n";
return true;
}
echo "[ERROR] Verification failed!\n";
return false;
}Run it in your PHP application:
$fileToSign = "document.pdf";
$tsrOutput = "document.pdf.tsr";
$tsaUrl = "https://tsa.example.com/tsa/get.aspx";
$caChain = "tsa.pem";
// 1. Request Timestamp
requestTimestamp($fileToSign, $tsrOutput, $tsaUrl);
// 2. Verify Timestamp
verifyTimestamp($fileToSign, $tsrOutput, $caChain);17.7 C# .NET: long-term signatures with SignLib
A signature that must stay verifiable for many years needs more than the signature itself. A long-term archival (LTA) signature carries a time stamp from your server, the validation data (the revocation information of the certificates) and an archive time stamp, so it can be validated long after the certificate has expired. The Signature Library (SignLib) for .NET creates these signatures and asks the server for the time stamps: https://www.signfiles.com/signature-library/. Needs: a .NET application with SignLib and its serial number.
| Format | Use it for | Result |
|---|---|---|
| PAdES-LTA | PDF documents | The signed PDF file, with the time stamp and the validation data embedded and protected for archiving. |
| CAdES-LTA | Any other file (Word documents, images, databases, archives) | A .p7m file (the file and its signature) or a detached .p7s file. |
| XAdES-LTA | XML data: B2B exchanges, e-invoicing (UBL, CII), reports | The XML document, with the time stamp and the revocation data embedded in the XML tree. |
| ASiC-E with XAdES-LTA | Several files signed together | One ZIP-based container (.asice) with the files and their signature. |
In all the examples, the constructor receives the serial number of the library, the certificate is chosen in the Windows store (DigitalCertificate.LoadCertificate() shows the certificates of the current user; a smart card, a token or an HSM can supply it), TimeStamping.ServerUrl points to your server and SignatureStandard selects the long-term format. With authentication, set TimeStamping.UserName and TimeStamping.Password (HTTP Basic authentication). The manual of the library describes every other option: https://www.signfiles.com/manuals/signature-library/.
PAdES-LTA: PDF documents. Proves that the document was signed while the certificate was valid, and protects it for long-term archiving.
using System;
using System.IO;
using SignLib.Certificates;
using SignLib.Pdf;
public static void SignPdfPadesLta(string inputFile, string outputFile, string serialNumber)
{
PdfSignature pdf = new PdfSignature(serialNumber);
pdf.LoadPdfDocument(File.ReadAllBytes(inputFile));
// 1. Load the signing certificate (Windows store, smart card or token)
pdf.DigitalSignatureCertificate = DigitalCertificate.LoadCertificate();
// 2. Configure the RFC 3161 time stamp server
pdf.TimeStamping.ServerUrl = new Uri("https://tsa.example.com/tsa/get.aspx");
// 3. Set Long-Term Archival (LTA) standard with the OCSP responses embedded
pdf.SignatureStandard = PdfSignatureStandard.PadesLTA;
pdf.PadesLtvLevel = PadesLtvLevel.IncludeOcspOnly;
// 4. Apply the signature
File.WriteAllBytes(outputFile, pdf.ApplyDigitalSignature());
}CAdES-LTA: any file. For the files that are not PDF documents. The signature is saved as a .p7m file (the file and the signature) or, with IsDetachedSignature, as a detached .p7s.
using System;
using System.IO;
using SignLib.Cades;
using SignLib.Certificates;
public static void SignCadesLta(string inputFile, string outputFile, string serialNumber)
{
CadesSignature cades = new CadesSignature(serialNumber);
// 1. Load the signing certificate
cades.DigitalSignatureCertificate = DigitalCertificate.LoadCertificate();
// 2. Set the time stamp server
cades.TimeStamping.ServerUrl = new Uri("https://tsa.example.com/tsa/get.aspx");
// 3. Set CAdES-LTA standard; false: .p7m with the file, true: detached .p7s
cades.SignatureStandard = CadesSignatureStandard.CadesLTA;
cades.IsDetachedSignature = false;
// 4. Sign the file
File.WriteAllBytes(outputFile, cades.ApplyDigitalSignature(inputFile));
}XAdES-LTA: XML documents. The time stamp and the revocation data are embedded in the XML document itself.
using System;
using SignLib.Certificates;
using SignLib.Xml;
public static void SignXadesLta(string inputXml, string outputXml, string serialNumber)
{
XadesSignature xades = new XadesSignature(serialNumber);
// 1. Load the signing certificate
xades.DigitalSignatureCertificate = DigitalCertificate.LoadCertificate();
// 2. Configure the RFC 3161 time stamp server
xades.TimeStamping.ServerUrl = new Uri("https://tsa.example.com/tsa/get.aspx");
// 3. Set XAdES-LTA standard
xades.SignatureStandard = XadesSignatureStandard.XadesLTA;
// 4. Sign the XML document
xades.ApplyDigitalSignature(inputXml, outputXml);
}ASiC-E: signature containers. An ASiC-E container binds one or more files and their signature (XAdES) in a single ZIP-based file.
using System;
using SignLib.Asic;
using SignLib.Certificates;
using SignLib.Xml;
public static void SignAsicELta(string[] inputFiles, string outputAsice, string serialNumber)
{
AsicSignature asic = new AsicSignature(serialNumber);
// 1. Load the signing certificate
asic.DigitalSignatureCertificate = DigitalCertificate.LoadCertificate();
// 2. Configure the RFC 3161 time stamp server
asic.TimeStamping.ServerUrl = new Uri("https://tsa.example.com/tsa/get.aspx");
// 3. The signature of the container is a XAdES-LTA signature
asic.SignatureStandard = XadesSignatureStandard.XadesLTA;
// 4. Sign the files and create the ASiC-E container (.asice)
asic.CreateContainer(inputFiles, outputAsice);
}17.8 PowerShell: long-term signatures with SignLib
The same long-term signatures, created from PowerShell with the Signature Library (SignLib): PAdES-LTA for PDF documents, CAdES for any file and XAdES-LTA for XML documents. The signature is time stamped by your server through the property TimeStamping.ServerUrl. Needs: Windows PowerShell 5.1 and SignLib.
About the examples:
- They follow the PowerShell scripts that come with the library (
signPdfPadesLTA.ps1,signInCAdESFormat.ps1,signXades.ps1).Initialize-SignLib,Get-SerialNumber,Get-SigningCertificateandGet-FullPathare helper functions of those scripts (the fileSignLibCommon.ps1): they loadSignLib.dll, return the serial number of the library, get the signing certificate from a PFX file or from the Windows store, and the full path of a file. Load them first with. .\SignLibCommon.ps1andInitialize-SignLib. - The scripts load the .NET Framework build of SignLib, which runs in Windows PowerShell 5.1 (
powershell.exe), not in PowerShell 7. - Each library script also takes the address of the server as a parameter, for example
powershell -ExecutionPolicy Bypass -File signPdfPadesLTA.ps1 contract.pdf -TimestampUrl https://tsa.example.com/tsa/get.aspx.
PAdES-LTA: PDF documents. The property PadesLtvLevel selects the validation data that is embedded: here the OCSP responses of the certificate.
# PowerShell example for PAdES-LTA
$sign = New-Object SignLib.Pdf.PdfSignature (Get-SerialNumber)
$sign.LoadPdfDocument([System.IO.File]::ReadAllBytes((Get-FullPath "document.pdf")))
# Set certificate from Windows store or Smart Card
$sign.DigitalSignatureCertificate = Get-SigningCertificate -Thumbprint "FAC4D3EF766A59BB068DD90877267EBC56B4232A"
# Configure RFC 3161 TSA Server
$sign.TimeStamping.ServerUrl = [Uri]"https://tsa.example.com/tsa/get.aspx"
# Apply PAdES-LTA standard
$sign.SignatureStandard = [SignLib.Pdf.PdfSignatureStandard]::PadesLTA
$sign.PadesLtvLevel = [SignLib.Pdf.PadesLtvLevel]::IncludeOcspOnly
# Save signed file
[System.IO.File]::WriteAllBytes((Get-FullPath "document_signed.pdf"), $sign.ApplyDigitalSignature())CAdES: any file. The signature is saved as a .p7m file. CadesLTA is the level for archiving (CadesA is the older archive level). The certificate comes from a PFX file here.
# PowerShell example for CAdES-LTA
$sign = New-Object SignLib.Cades.CadesSignature (Get-SerialNumber)
$sign.DigitalSignatureCertificate = Get-SigningCertificate -PfxFile "certificate.pfx" -PfxPassword "123456"
# Configure CAdES level and TSA server
$sign.SignatureStandard = [SignLib.Cades.CadesSignatureStandard]::CadesLTA
$sign.TimeStamping.ServerUrl = [Uri]"https://tsa.example.com/tsa/get.aspx"
# Apply signature to file
[System.IO.File]::WriteAllBytes((Get-FullPath "document.p7m"), $sign.ApplyDigitalSignature((Get-FullPath "document.pdf")))XAdES-LTA: XML documents. For XML documents and e-invoicing.
# PowerShell example for XAdES-LTA
$sign = New-Object SignLib.Xml.XadesSignature (Get-SerialNumber)
$sign.DigitalSignatureCertificate = Get-SigningCertificate -Thumbprint "FAC4D3EF766A59BB068DD90877267EBC56B4232A"
# Set XAdES-LTA standard and TSA server
$sign.SignatureStandard = [SignLib.Xml.XadesSignatureStandard]::XadesLTA
$sign.TimeStamping.ServerUrl = [Uri]"https://tsa.example.com/tsa/get.aspx"
# Apply XML signature
$sign.ApplyDigitalSignature((Get-FullPath "invoice.xml"), (Get-FullPath "invoice_signed.xml"))18. Trial period and registration
The licensed edition of PKISimple TSA Server starts as a trial version. A license, pasted on the Registration page, lifts every limit at once.
Source Edition: there is no trial period and no license. The main page shows "Registered Version", and the Registration page only says "PKISimple TSA Server is registered."
18.1 The trial period
- Every function of the server works during the trial.
- The trial lasts 45 days from the first start of the server, for at most 5,000 time stamps, whichever comes first.
- Every issued time stamp counts: RFC 3161 and Authenticode, including the test time stamps of the administration pages (Issue a Test Time Stamp, Time Stamp a File, the tests of the Status page). Refused requests do not count.
The main page shows License Status "Trial version" and a yellow box:
PKISimple TSA Server is not registered.
Trial version: 38 days and 4,870 time stamps left (of 45 days and 5,000 time stamps), until 2027-01-07. When the trial period ends, the server refuses every time stamp request. A license lifts every limit at once, without reinstalling.with the buttons Register Now and Buy a license (chapter 5). The line is shown in bold when 7 days or 500 time stamps are left, and the Status page then shows a warning for the license (chapter 14).
18.2 When the trial ends
At the end of the 45 days, or after the 5,000th time stamp, the server refuses every time stamp request. The administration pages keep working, so you can register the server at any time.
| Situation | Main page | Text sent to the client |
|---|---|---|
| The 45 days are over | "Trial version, ended" in red; "The trial period ended on date: time stamps are not issued." | "The trial version is expired." |
| 5,000 time stamps issued | "The trial version issued its maximum of 5,000 time stamps: time stamps are not issued." | "The trial version issued its maximum of time stamps." |
An RFC 3161 client receives a rejection response with this text (failure systemFailure); an Authenticode client receives HTTP status 503 with the text. The main page shows the License error in its status warning, and so does the Status page.
The end of the trial is written once to the Audit Trail: Trial period ended, or Trial: maximum of time stamps reached ("The trial version issued its maximum of 5,000 time stamps: time stamps are not issued until a license is registered (Registration page).").
With several worker processes (a web garden), each process adds its count in the background, so the maximum can be passed by the few time stamps issued within one interval.
18.3 What does not restart the trial
The server keeps the start of the trial and the number of time stamps issued in two signed records, one in the database and one in the file App_Data\settings\tsademo.sys, and also takes the date of the first event of the Audit Trail into account. The earliest start and the highest count win. Therefore:
- deleting the database or the file
tsademo.sys, or restoring an older backup, does not start a new trial; - setting the clock of the server back by more than one day ends the trial: "The trial period ended on date (the clock of the server was set back): time stamps are not issued.";
- a record changed by hand ends the trial: "… (its records were changed): time stamps are not issued."
A small correction of the clock (less than a day back) has no effect. A registered server writes nothing to these records.
18.4 Registering the server

- Buy a license (Buy a license opens the order page of the vendor). You receive a license text.
- On the main page, click Register Now. The Registration page opens; it shows the state of the trial at the top.
- In Paste the license text you received, paste the whole text, as received. Line breaks and spaces do not matter, so a text copied from an e-mail works.
- Click Register Now.
The page says "PKISimple TSA Server was successfully registered: licensed to customer (license issued date)." The limits are lifted at once, without a restart, and the main page shows License Status "Licensed to customer".
About the license:
- it names the customer ("Licensed to …") and the date it was issued;
- it does not expire, and it is valid for every version of the server;
- it is not bound to a server: the same text registers another installation, for example after a move;
- it is kept in the database, so it is in every backup (chapter 19). A restore keeps the license of the server; a server without a license takes the license of the backup. Keep the license text you received.
18.5 Changing the license
On a registered server the Registration page shows "PKISimple TSA Server is registered. Licensed to customer (license issued date)." and accepts another license text, for example after a correction of the company name:
- Open the Registration page with Change the license on the main page.
- Paste the new text in To register the server for another name (for example a corrected company name), paste the new license text and click Register Now.
- Confirm "Replace the license of customer with the new license?".
The page says "The license was replaced: PKISimple TSA Server is now licensed to customer (license issued date)." A text that is not a valid license changes nothing: the current license stays registered.
18.6 Messages of the Registration page
| Message | Cause |
|---|---|
| "Paste the license text." | The box is empty. |
| "This is not a license of PKISimple TSA Server (the text cannot be read). Paste the whole text you received." | The text is incomplete, damaged, or the license of another product (a license of PKISimple CA Server, for example, is not accepted). |
| "The license is not valid: its signature does not match (the text was changed, or it was not issued by Secure Soft)." | The text was changed. Paste it again from the original message. |
| "This license is for another version of the license format: ask for a new license text." | Ask the vendor for a new text. |
| "This license is already registered: licensed to customer." | The text pasted is the license in use; nothing changes. |
| "… The license of customer stays registered." | Added to a refusal on a registered server. |
18.7 Audit entries
The Audit Trail (chapter 12) records:
| Event | When |
|---|---|
| License registered | "The server was registered: licensed to …", or "The license was replaced: licensed to … (before: licensed to …)." |
| License refused | "A license was refused: …" with the reason, for each refused text. |
| Trial period ended | Once, when the trial ends. |
| Trial: maximum of time stamps reached | Once, when the 5,000th time stamp is issued. |
19. Backup, restore, move and upgrade
PKISimple TSA Server keeps all its data in one SQLite database, App_Data\settings\tsa.db. The Backup and Restore page (menu Backup) makes consistent copies of it while the server keeps working, checks backup files and restores them. This chapter also explains how to move the server to another machine and how to upgrade.

19.1 What to back up
| Item | Where | Why |
|---|---|---|
| A database backup | The Backup and Restore page: a download, or a copy in App_Data\backups | The configuration, the TSA users and their counters, the administrator account, the certificates and keys (encrypted), the audit trail, the response log and the license. |
secret.key | App_Data\settings\secret.key | The keys that protect the PFX files, the PFX password and the PKCS#11 PIN stored in the database are derived from it. A backup cannot be used without the secret.key of the same installation. It never changes after the first start: back it up once, keep it apart from the database backups, and protect it like a private key. |
| The license text | The e-mail of the vendor | It is in the database and in every backup, but keep the text too: pasting it on the Registration page registers any installation again. |
certengine.sys (optional) | App_Data\settings | The counters of the main page (time stamps issued, requests rejected). Statistics only. |
| Keys outside the server | The Windows certificate store, the HSM or token | When the server signs with a certificate of the Windows store or with a key on a PKCS#11 device, the backup holds only the reference to it (the thumbprint, or the public certificate and the encrypted PIN). Back up that key with the tools of Windows or of the device, if it can be backed up. |
Do not copy tsa.db with a file copy while the site runs: the latest changes may be in tsa.db-wal, and a copy made during a write is not consistent. Use the Backup and Restore page, or stop the site and copy tsa.db, tsa.db-wal and tsa.db-shm together.
Make a backup right after you create, select or renew the time stamp certificate: a new certificate usually means a new key.
Make a backup after the installation, after every change of the certificate, of the configuration or of the users, and regularly (the Status page warns when the newest backup is older than 30 days). Copy the backups and secret.key to storage away from the server.
19.2 The Database line
The section Database at the top of the page shows the state of the database file:
| Part | Meaning |
|---|---|
App_Data\settings\tsa.db: …, WAL … | The size of the database file and of its write-ahead log (WAL), where the latest changes are kept until they are copied into the file. A journal mode other than WAL is named. |
| "Unused … (reclaimed automatically)" or "Unused … (reused)" | Space left in the file by deleted entries (old audit entries, response log entries). On a database with automatic compaction it is given back to the disk gradually, in the background; otherwise it is reused by new entries. |
| "Integrity check passed at startup (… s)." | The integrity check made when the application started passed. |
| "Integrity check running in the background." | A large database is checked in the background while the server works. |
| "The integrity check failed when the application started: … The server refuses time stamps and changes until a backup is restored below." | The database is damaged: restore the last good backup (19.5). |
Background writer (click it to unfold; it opens by itself when entries were dropped or the writer had an error) describes the worker process that answers the page. The server does not write the user counts and the response log on each request: a background writer stores them, by default every second.
| Part | Meaning |
|---|---|
| Background writer: n s interval, n passes, max n ms | Its interval (setting Tsa.FlushIntervalSeconds of Web.config, 1 to 10 seconds), how many times it ran since the start, and its longest pass. |
| Response log queue waiting/maximum, dropped n | The response log entries waiting in memory, the most that can wait (setting Tsa.ResponseLogMaxBuffered, 100,000 by default), and the entries dropped because the queue was full (Time Stamp Responses). |
| Checkpoints n, max n ms | The copies of the write-ahead log into the database file, and the longest one. |
| Reclaimed … | The space given back to the disk by the compaction, when there was some. |
| Last error time: … | The last error of the writer, when there was one. |
19.3 Making a backup
The Administrator password box is needed to download or restore a backup (the file holds the accounts and the encrypted keys). Type it before you click the button.
| Button | What it does |
|---|---|
| Download a Backup | Makes a consistent copy of the database while the server keeps working and sends it to the browser as TSAServer_Backup_yyyyMMdd_HHmm.db. Requires the administrator password. |
| Make a Backup on the Server | Makes the same copy in App_Data\backups\tsa-yyyyMMdd-HHmmss.db. The message says "The backup … was made in App_Data\backups. Copy it to another disk too." |
- Up to date. The user counts and the response log entries that the server keeps in memory are written to the database before the copy, so a backup is as current as the worker process that made it. Other worker processes of a web garden write theirs within their own interval.
- Disk space. A backup is refused when the disk has less free space than the size of the database: "The backup cannot be made: The disk has … free, not enough for a copy of the database (…)."
- Safe folder.
App_Data\backupsis never served by IIS. It is on the same disk as the database, so copy the backups to another disk or another machine. - No automatic deletion. The server does not delete old backups: remove them by hand.
- No scheduler. Backups are made by hand. For unattended backups, schedule a copy (for example with the Task Scheduler of Windows) of the files of the backups made on the server, or stop the site at a quiet time and copy the data folder.
- Every backup, download, check and restore is recorded in the Audit Trail.
Backups on the server lists the files of App_Data\backups: File, Made (UTC), Size, Kind ("made on the server", or "before a restore" for the copy that a restore saves first), with the links Check and Download (the download also needs the administrator password).
Source Edition: there is no password box; the buttons work without it.
19.4 Checking a backup
Every file is checked before it can be restored, and a file can be checked on its own:
- for a backup of the server: Check in the list;
- for a file of your computer: choose it in Check and restore a backup (up to 2 GB) and click Check the File. The uploaded file waits on the server for its restore, and is deleted after an hour.
The file is opened read-only. The result starts with one line: "a good backup of this server: it can be restored.", "it can be restored, with the remarks below." or "this backup cannot be restored.", followed by each check:
| Check | Error (cannot be restored) / warning (can be restored after accepting the remarks) |
|---|---|
| File | Error when the file is not a SQLite database, or is not a backup of PKISimple TSA Server 7.6. |
| Integrity | Error when the file is damaged. |
| Version | Error when the file has another database format (for example a development build made it). |
| Configuration | Error when the secrets of the backup cannot be decrypted with the secret.key of this installation: the backup belongs to another installation, or was modified. Restore it together with the secret.key of the installation that made it (19.6). Warning when the backup has no configuration (the server would create a new certificate for itself). |
| Signing certificate and key | Error when the PFX file of the backup is missing or its key cannot sign. Warning when it is not the certificate in use now (the certificate was changed after the backup), or when the key is in the Windows certificate store or on a PKCS#11 device (outside the backup: the restored server needs that certificate or device). |
| Contents | The number of TSA users, counted requests, audit entries and logged responses, and the time of the newest audit entry. Warning when this server recorded audit entries after the backup: a restore loses what was done since. Make a new backup before restoring. |
| Administrator account | Warning when the backup has none: after a restore, whoever opens the login page first creates it. Create it at once, from the server itself. |
| License | Says which license applies after a restore (19.8). |
| Audit trail | Error when the hash chain of the audit trail in the file is broken: the file was modified. |
The check is recorded in the audit trail (Backup file checked), with every result.
19.5 Restoring a backup on the same server
- Check the file (19.4).
- Read the remarks. When there are warnings, tick "I have read the remarks of the check and restore anyway."
- Type the administrator password and click Restore this Backup, then confirm.
The page says first what the restore loses: "The restore brings back the database of the file: what was done on this server after the file was made is lost (configuration and user changes, the requests counted against the quotas, audit entries, the response log). The database as it is now is saved first in App_Data\backups."
The server then:
- checks the file again;
- writes the counts and the log entries waiting in memory;
- saves the current database as
App_Data\backups\before-restore-yyyyMMdd-HHmmss.db(so a restore can be undone by restoring that file); - copies the backup beside the database while the site keeps running, then replaces the database file in one step (the writes of the server wait for milliseconds);
- forgets its caches and the user counts still in memory;
- ends every administrator session;
- records the restore in the audit trail of the restored database (Database restored from a backup) and publishes the TSA certificate of the restored configuration (
TSACertificate.crt).
The login page then shows "The database was restored from …. The database before the restore was saved as …. Every login session was ended: log in with the administrator account of the restored database." Log in with the account of the backup, then run the tests of the Status page or Issue a Test Time Stamp.
What is lost: everything done after the backup was made: configuration and user changes, the requests counted against the quotas (the users get them back), audit entries and logged responses. certengine.sys and the record of the trial period are not in the database and are not changed by a restore.
Several worker processes (web garden). When another worker process has the database open, the file cannot be replaced: the backup is then copied into the open database. This is correct but slow for a large database (measured: 14 to 20 minutes for 13 to 21 GB; the write-ahead log grows to the size of the database, and the response log entries of that time are dropped). Restore a large database with a single worker process, or stop the other ones first. The other worker processes reload the configuration and the users within one interval of their background writer.
Source Edition: no password and no login: after the restore the main page opens.
19.6 Moving to another server, or recovering a lost server
- Install PKISimple TSA Server 7.6 on the new server (Installation on IIS), but do not open the site yet.
- With the site stopped, copy into
App_Data\settingsof the new server: the oldsecret.key, optionallycertengine.sys, and the database backup renamed totsa.db. Delete anytsa.db-walandtsa.db-shmof the new installation first. - If the configuration signs with a certificate of the Windows store, install the certificate and its private key on the new server and give the account of the application pool the right to use the key (The time stamp certificate). For a PKCS#11 device, install the software of the device and check the library path and the slot (HSM, smart cards and USB tokens).
- Start the site. The database is checked at the start: the Backup and Restore page shows "Integrity check passed at startup".
- Click Issue a Test Time Stamp on the Configuration page (Testing the server).
- The license came with the database. If the main page shows a trial version, paste the license text on the Registration page (Trial period and registration).
- Give the clients the new address, or move the DNS name of the old server to the new one.
Another way: start the new installation with the old secret.key only (step 2 without the database), accept the license agreement and create a temporary administrator account, then restore the backup from the Backup and Restore page (19.5).
19.7 A damaged or missing database, a lost secret.key
| Situation | What happens and what to do |
|---|---|
| The integrity check failed (red message on the administration pages) | The server refuses time stamps and changes. Restore the last good backup (19.5); the damaged database is kept as before-restore-…. |
The database cannot be opened (message "The database cannot be opened: …"; the details are in App_Data\settings\startup-error.txt) | Usually the rights of the application pool on the folder, a missing bin\runtimes\…\e_sqlite3.dll, or a folder on a network drive. Fix the cause and recycle the application pool. If the file itself is unusable, stop the site, replace tsa.db with a backup (as in 19.6, step 2) and start it. |
| The database was deleted | The next start creates an empty database: the first-start configuration, a new certificate with a new key, no administrator, no license. The trial period does not start again while App_Data\settings\tsademo.sys remains. Restore a backup, or configure the server again and register the license again. |
secret.key was lost | The PFX files, the PFX password and the PIN in the database, and in every backup, cannot be decrypted any more; the configuration cannot be read. Restore secret.key from its backup. Without it: delete tsa.db, configure the server again, and paste the license text on the Registration page (the license does not depend on secret.key). The counters of the main page start again from 0 (certengine.sys is encrypted with secret.key). |
What a crash can lose. A change saved before a crash, a kill or a recycle of the worker process is never lost, and the file stays consistent. A power failure or a crash of Windows can lose the last changes (typically the last counted requests and logged responses), but does not damage the file. Up to one second of the counters of the main page can be lost when a process is killed.
19.8 The license after a restore or a move
The license is stored in the database, so it is in every backup.
- A restore keeps the license of the server: a backup made before the registration does not turn the server into a trial version again.
- A server without a license takes the license of the backup.
- A restore never gives back days or time stamps of the trial period.
The License line of the check of a backup says which case applies, for example "The license of this server (Licensed to …) is kept after the restore". Keep the license text that you received: it registers a new installation too.
Source Edition: there is no license, and the check of a backup has no License line.
19.9 Upgrading
From version 7.5 or earlier. Version 7.6 is a new installation. It keeps its data in a database and does not read the data files of 7.5 and earlier (config.sys, users.sys, admpswd.sys, the log files, the folder of the certificates): there is no migration. To upgrade:
- Install 7.6 in a new folder, as a new IIS application (Installation on IIS). Leave the old installation as it is for now.
- Configure 7.6 again: the time stamp certificate (load the PFX file again, select the certificate of the Windows store or set up the PKCS#11 device), the options of the Configuration page, and the users and their passwords.
- Test the new server (Testing the server).
- Move the clients to the new address, or point the old address to the new application, when the new server works.
- Keep the folder of the old installation as an archive of its logs and responses: 7.6 does not import them.
Keep the old time stamp certificate available to the people who verify time stamps issued by the old server.
To a newer build of 7.6. Make a backup first (19.3) and keep secret.key. Stop the application pool, copy the new files over the old ones, and start it again. Never delete or replace the folder App_Data: it holds the data of the server, including the key of the certificate created at the installation. If you changed Web.config, make the change again in the new file. Then test the server.
20. Files and folders
PKISimple TSA Server keeps everything it writes inside its own application folder: in App_Data\settings, in App_Data\backups and, for the public certificate, TSACertificate.crt. A certificate that you select from the Windows certificate store, and a key on a PKCS#11 device, stay where they are: the database keeps only a reference to them (and the encrypted PIN).
20.1 The application folder
| Item | Content |
|---|---|
*.aspx | The pages of the server; get.aspx is the time stamp service. |
Web.config | The settings of IIS and ASP.NET for the application: request size limits, protection of the data files, security headers (20.5). |
PrecompiledApp.config | Marks the application as precompiled. Do not change or delete it. |
bin\ | The program and its libraries. bin\runtimes\win-x64\native and bin\runtimes\win-x86\native hold the SQLite engine (e_sqlite3.dll) for 64-bit and 32-bit application pools. |
bootstrap.min.css, bootstrap.bundle.min.js | The web design of the pages. |
TSACertificate.crt | The public certificate of the time stamp certificate in use, offered by Download the Time Stamp Certificate. Written by the server at the first start, when another certificate is selected or created, and after a restore. It contains no private key and is meant to be downloaded. |
App_Data\settings\ | The database and the few files that stay outside it (20.2). |
App_Data\backups\ | The backups made on the server (20.3). |
The package contains the folder App_Data empty: the files below are created by the server at its first start.
20.2 The files of App_Data\settings
| File | Content |
|---|---|
tsa.db | The database: the configuration, the time stamp users and their counters, the administrator account, the certificates and their keys (the PFX files, the PFX password and the PKCS#11 PIN, encrypted), the license, the Audit Trail and the response log. |
tsa.db-wal, tsa.db-shm | The write-ahead log and its index, beside the database while the server runs. The latest transactions can be in tsa.db-wal: never copy tsa.db alone while the site runs. |
secret.key | The secret of the installation (32 random bytes), created at the first start. The keys that protect the secrets of the database (PFX files, PFX password, PIN), the file certengine.sys and the login cookie of the administrator are derived from it. It never changes after the first start. A backup of the database cannot be used without the secret.key of the same installation. |
certengine.sys | The counters of the main page (Number of time stamps issued, Number of requests rejected), encrypted with a key derived from secret.key. Statistics only. |
tsademo.sys | Licensed edition: the record of the trial period, kept outside the database (the other record is in the database). Not changed by a restore. |
invalidtime.sys | Created and deleted only by an external clock monitor, never by the server. While it exists, every time stamp request is refused (Synchronize the clock of the server). |
reset-admin.txt | Licensed edition: created by you, empty, to reset a forgotten administrator password. The server writes a one-time code into it and deletes it after the reset (License agreement and administrator account). |
startup-error.txt | Written only when the database cannot be opened, with the reason (useful at a hosting provider, where you can read it by FTP). When the database works again, the server moves the text into the Audit Trail and deletes the file. |
instance_slot_0.lock … instance_slot_9.lock | Held by the running worker processes (one each) while they work; Windows deletes them when the process ends. Do not delete them. |
*.tmp | Temporary files: a download of a backup (download-*.tmp), a file uploaded to be checked (check-*.tmp), a restore being prepared (restore-*.tmp), or a file being written. The server deletes them itself; those left by a stopped process are deleted when they are older than an hour. |
Source Edition: there is no tsademo.sys and no reset-admin.txt (no trial, no administrator account).
20.3 The folder App_Data\backups
| File | Content |
|---|---|
tsa-yyyyMMdd-HHmmss.db | A backup made with Make a Backup on the Server (the time is UTC). |
before-restore-yyyyMMdd-HHmmss.db | The copy of the database that the server makes automatically before a restore. |
backup-*.tmp | A backup being written; it is renamed to its final name when it is complete. |
The server never deletes old backups: remove them by hand. Copy them to separate storage too: a backup on the same disk does not survive the loss of the disk. A backup downloaded with Download a Backup is named TSAServer_Backup_yyyyMMdd_HHmm.db and is not kept on the server.
20.4 What to back up
| What | Why |
|---|---|
| A backup of the database (Backup and Restore page) | Everything of the server: configuration, users and their counters, administrator account, certificates and keys (encrypted), license, Audit Trail, response log. |
App_Data\settings\secret.key | Once, kept apart from the database backups and protected like a private key. Without it a backup cannot be restored. |
App_Data\settings\certengine.sys | Optional: the counters of the main page. |
| The license text you received | It is in the database, but the text registers any installation again (Trial period and registration). |
| Keys outside the server | A certificate in the Windows certificate store or a key on a PKCS#11 device is not in the backup (only its reference and the encrypted PIN): back it up with the tools of Windows or of the device, if it can be backed up. |
Do not copy tsa.db with a file copy while the site runs. Use the Backup and Restore page, or stop the site and copy tsa.db, tsa.db-wal and tsa.db-shm together. Details: Backup, restore, move and upgrade.
20.5 What IIS never serves
The data of the server cannot be downloaded through the web site:
App_Datais never served by ASP.NET and IIS, also on a server without the Request Filtering module of IIS and at a hosting provider that ignores the rules ofWeb.config. This is the main protection: every data file is there.- As a second layer,
Web.confighides every path segment namedsettingsorbackups, and refuses the file extensions.sys,.db,.db-wal,.db-shm,.key,.pfxand.p12. binis never served by ASP.NET.
Web.config also:
| Setting | Value |
|---|---|
| Size of a request | 64 KB for the time stamp service (get.aspx), 4 MB for Time Stamp a File, 2 MB for Verify a Time Stamp, up to 2 GB for a backup uploaded to the Backup and Restore page, 512 KB for the other pages. |
| HTTP methods | TRACE and OPTIONS are refused. |
| Security headers | X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy and Content-Security-Policy are added to the answers; X-Powered-By and the ASP.NET version header are removed. |
| Cookies | All cookies are HttpOnly and SameSite=Strict. |
| Errors | Detailed error pages are shown only on the server itself, never to remote visitors. |
If you change Web.config, keep a copy of your change: an update of the server replaces the file.
21. Security recommendations
A time stamp server is trusted only as far as its key, its clock and its administration are protected. The recommendations below apply to PKISimple TSA Server 7.6; most of them are steps of the installation.
21.1 Installation
- Accept the license agreement and create the administrator account at once, from the server itself (
http://localhost/...), before the server is reachable from the network. Until the account exists, the first visitor of the login page can create it (License agreement and administrator account). - Choose a strong administrator password, used for nothing else. The login page refuses a client for a while after repeated wrong passwords ("Too many failed attempts. Try again in … seconds."), and every login, failed login and logout is written to the Audit Trail.
- Source Edition: the administration pages have no login. Everybody who can open them can change the settings, the time stamp certificate and the users, and can read the logs. Install it only where you trust everybody who can reach it, and never publish it on the internet.
21.2 HTTPS
- Use HTTPS for the whole site: add an HTTPS binding with a server (TLS) certificate (Installation on IIS). It protects the administrator password, the login cookie and the passwords of the time stamp users.
- The login cookie is not restricted to HTTPS (the server also works over HTTP), but over HTTPS it is marked Secure. Over HTTP the login page warns that the password is sent in clear text: log in over HTTP only on the server itself.
- All the cookies of the server are HttpOnly and SameSite=Strict, and the forms of the administration pages are bound to the login session, so a page of another site cannot make changes in the name of a logged-in administrator.
21.3 Exposure of the administration pages
What is public and what is not:
| Address | Who can use it |
|---|---|
get.aspx (the time stamp service) | Every client that reaches the site; with Require authentication, only your users. |
TSACertificate.crt | Everybody: it is the public certificate, meant to be downloaded. |
| Every other page, including Time Stamp a File and Verify a Time Stamp | Licensed edition: only the administrator, after the login. Source Edition: everybody. |
- If the time stamp service is offered to a wider network than the administrators, limit the networks that can open the administration pages, for example with the IP Address and Domain Restrictions feature of IIS, or publish only
get.aspxthrough your reverse proxy or firewall. KeepTSACertificate.crtreachable if your clients download it. - Log out (menu bar) when you leave the pages, especially on a shared computer.
- Do not set
customErrorstoOffinWeb.config: the detailed error pages are meant for the server itself only. Likewise, the details of a configuration problem (paths of the data folder) are shown only on the server itself; remote visitors get a general message.
21.4 Client authentication
- Turn on Require authentication if the time stamps must be issued only to your users, and give each client its own user, with a maximum number of time stamps where it makes sense (Users and authentication). A disabled user is refused at once.
- Prefer HTTP Basic authentication (the
Authorizationheader) where the client supports it. - Passwords in the address (
get.aspx?u=…&p=…): use them only for clients that accept nothing but a URL, and only over HTTPS. A password in the address can end up in the IIS log (IIS records the query string by default), in the logs of proxies and in the configuration of the client. Give such users their own password, and change it when it may have been seen. - Over plain HTTP, Basic authentication and the query string both send the password readable.
- After repeated wrong passwords for a user or from an IP address, the server refuses that client for a while ("Too many failed authentication attempts. Try again later."); the refusals are in the Audit Trail.
21.5 The key of the time stamp certificate
- For a public service, use an HSM (or at least a smart card or a USB token) through PKCS#11: the key never leaves the device (HSM, smart cards and USB tokens). A key in a PFX file is a software key: whoever gets the database together with
secret.keycan use it. - PFX password (Create Certificate): it alone protects the private key of the PFX file you download. Use 16 or more random characters.
- The certificate created at the installation and the certificates made with Create New Certificate are self-signed: use them for tests and internal use only. For time stamps that other people rely on, use a certificate issued by a certification authority they trust (The time stamp certificate).
- Watch the expiry date of the certificate: the main page and the Status page warn in its last 30 days.
21.6 secret.key, the database and the backups
App_Data\settings\secret.keyis the root of every key of the installation: the PFX files, the PFX password and the PKCS#11 PIN in the database are encrypted with keys derived from it, and so is the login cookie of the administrator. Protect it like a private key. Back it up once, and keep the copy apart from the database backups: a backup together with itssecret.keygives access to the keys of the server.- The database is not encrypted as a whole. The secrets are encrypted per field, but the rest (configuration, user names, Audit Trail, response log) is readable by whoever can read
tsa.dbor a backup. Treat every backup as confidential. - Downloading a backup and restoring one require the administrator password again; every backup, download, check and restore is written to the Audit Trail.
- Copy the backups off the server (
App_Data\backupsis on the same disk) to storage with restricted access, and delete the old ones you no longer need: the server never deletes them (Backup, restore, move and upgrade). - Keep the license text in a safe place: it registers any installation.
21.7 Rights on the files
- Give access to the application folder only to the account of the application pool (Modify) and to the administrators of the machine. Do not give rights to Everyone or to the Users group.
- Run the pool with ApplicationPoolIdentity, or with a dedicated account that has only the rights it needs. LocalSystem can help to diagnose a problem with a device; do not keep it.
- Whoever can write in
App_Data\settingscan reset the administrator account (reset-admin.txt) or stop the time stamps (invalidtime.sys); whoever can read it can copy the database andsecret.key. Limit the remote access (file shares, FTP, remote desktop) to the server accordingly. - Keep the protections of
Web.config(Files and folders). If you change the file, keep a copy of your change: an update replaces it.
21.8 Clock, monitoring and the Audit Trail
- Keep the clock synchronized and watch it; if you monitor it, let your monitor stop the time stamps while it is wrong (
invalidtime.sys, Synchronize the clock of the server). - Look at the Status page regularly, or at the warning of the main page: it shows the license, the certificate, the clock, the database, the free space, the last backup, and the results of the daily tests (Status page).
- The Audit Trail is protected by a hash chain: use Verify the Whole Trail from time to time, and export the months you must keep before you delete them (Audit Trail).
- Keep Windows, IIS and the .NET Framework up to date.
22. Problems and solutions
The messages below are the texts that PKISimple TSA Server shows on its pages or sends to the clients. A text in italics inside a message (…) is a part that changes: a path, a date, a number or the text of Windows. Many messages have more details in the Audit Trail (chapter 12), and the Status page (chapter 14) shows in one place everything that can stop the server from issuing time stamps.
Start with the Status page and the Audit Trail: the Status page shows what is wrong now, and the Audit Trail records the cause of every failure. For a problem with a key, use Digital Certificate Tester (section 08.12); for a problem of the clients, Time Stamp Client (section 15.5).
22.1 Installation and start
| Problem / message | Cause | Solution |
|---|---|---|
| An IIS error page, or no page, when you open the address of the application | ASP.NET 4.8 is not enabled in IIS, the application pool is not .NET CLR v4.0 with the Integrated pipeline, or the physical path of the application is wrong. | Check the steps of Installation on IIS. |
The address …/get.aspx opened in a browser shows PKISimple TSA Server: RFC 3161 and Authenticode time stamp server | Not a problem: a browser sends no time stamp request. | Test the address with a client (chapter 15). |
The application cannot write to its data folder (folder):errorGive the application pool account (or the account of the hosting plan) the right to modify this folder. | The account of the application pool cannot write in App_Data. | Give it the Modify right, for example icacls "C:\inetpub\TSAServer" /grant "IIS AppPool\TSAPool:(OI)(CI)M" (chapter 3). |
The application runs in partial trust (Medium Trust): the signing keys and the PKCS#11 devices cannot be used. Ask the hosting provider to run the site in Full Trust. | A shared hosting runs the site in partial trust. | Ask the hosting provider for Full Trust. |
The database cannot be opened: DllNotFoundException: The SQLite engine was not found (path). Copy the bin folder of the server again, with its runtimes subfolder. (also in App_Data\settings\startup-error.txt) | The folder bin\runtimes (the SQLite engine e_sqlite3.dll) was not copied. | Copy the whole bin folder again, with bin\runtimes\win-x64 and bin\runtimes\win-x86. |
The database cannot be opened: DllNotFoundException: The SQLite engine (path) cannot be loaded: Windows errornumber. | Usually Windows blocks the file: the downloaded zip file was marked as blocked, so the files extracted from it are blocked too. | Right-click the zip file, Properties, tick Unblock, extract it again and copy the files. |
The database is not in WAL mode (journal modemode): the data folder must be on a local disk (not a network share). Concurrent requests wait for each other. | The application folder (and App_Data) is on a network share. SQLite write-ahead logging does not work on network file systems. | Move the application to a local disk (chapter 19 describes a move). |
The database failed its integrity check when the application started (problem): restore the last backup (see the Backup page). | The database file tsa.db is damaged (disk error, file copied while in use). The server refuses time stamps and changes. | Restore the last good backup on the Backup and Restore page (chapter 19). |
The file App_Data\settings\startup-error.txt exists | The database could not be opened at a start; the file holds the reason. | Correct the cause. When the database opens again, the server moves the text into the Audit Trail and deletes the file. |
The server has a configuration problem. The details are shown when this page is opened on the server itself (http://localhost/...), and in the Audit Trail. | The login page shows the details of a problem of the server only to a browser on the server itself. | Open the page on the server with http://localhost/…, or read the Audit Trail. |
The audit trail cannot be written (nevent(s) lost since the start; last error:error). | The database cannot be written: a full disk, a lost right, a damaged file. | Check the free space and the rights of App_Data\settings, and the Status page. |
22.2 Login and the administrator account
These messages do not exist in the Source Edition, which has no administrator login.
| Problem / message | Cause | Solution |
|---|---|---|
Read the license agreement to its end and tick the box to accept it. | Accept and Continue was pressed without the box ticked. | Scroll the agreement to its end, tick the box, press Accept and Continue (chapter 7). |
This connection is not encrypted (HTTP): the password is sent in clear text. Use HTTPS when the server can be reached from other networks. | The login page was opened with an http:// address. | Use HTTPS (chapter 21). On the server itself, for a first test, the warning can be ignored. |
Invalid credentials. Forgot the password? On the server, create an empty file named reset-admin.txt in App_Data\settings and reload this page: it asks for the code that the server writes into that file. | Wrong user name or password of the administrator. | Type them again. If they are lost, reset the account with reset-admin.txt (chapter 7). |
Too many failed attempts. Try again innseconds. | Several wrong passwords in a short time. | Wait, then log in with the right password. |
Wrong code. Type the code written in the file reset-admin.txt on the server. | The code typed for the reset is not the code of the file. | Open App_Data\settings\reset-admin.txt again and copy the code. |
The code in the file had expired: a new code was written in the file. Open it again. | The code is valid for one hour. | Open the file again and use the new code. |
No reset of the administrator account was requested on the server. | The file reset-admin.txt does not exist (or was deleted). | Create the empty file in App_Data\settings and reload the login page. |
The administrator account was reset, but the file reset-admin.txt cannot be deleted: delete it on the server, then log in. | The account of the pool cannot delete the file. | Delete the file yourself. |
22.3 A client does not receive a time stamp
An RFC 3161 client receives the refusal as an RFC 3161 response with the status rejection and the text below (HTTP 200); openssl ts -reply -in response.tsr -text shows it. An Authenticode client receives an HTTP error with the same text: 403 for credentials and quota, 503 when the server cannot issue time stamps, 400 for a malformed request, 500 for an error of the server. Every refusal is written to the Audit Trail and counted in Number of requests rejected on the main page.
| Problem / message | Cause | Solution |
|---|---|---|
The server is not installed yet: its administrator must open the administration pages, accept the license agreement and create the administrator account. | A new installation: the license agreement was not accepted, or the administrator account was not created. | Open the administration pages, accept the agreement and create the account (chapter 7). |
The trial version is expired. | The 45 days of the trial period ended. | Register a license (chapter 18). |
The trial version issued its maximum of time stamps. | The trial period issued its 5,000 time stamps. | Register a license (chapter 18). |
TSA time is desynchronized. | The file App_Data\settings\invalidtime.sys exists: an external clock monitor marked the clock as wrong. The main page says The clock is marked as desynchronized (App_Data\settings\invalidtime.sys exists): the server refuses every time stamp request until the file is deleted. | Synchronize the clock, then delete the file (or let the monitor delete it) (chapter 4). |
Invalid credentials to login to the TSA server. | Require authentication is on and the request has no user name, an unknown user or a wrong password. | Give the client the credentials: HTTP Basic authentication or ?u=…&p=… in the address, with special characters percent-encoded (chapter 11). The Audit Trail says which case it was. |
Too many failed authentication attempts. Try again later. | Repeated wrong passwords for a user, or from the same IP address: the server refuses that client for a while. | Correct the password stored in the client and wait. A request with the right password, already verified, is still accepted. |
User is not active. | The user is disabled. | Tick User is enabled on the Users page and save. |
Not enough time stamp requests. | The user reached its maximum number of time stamps. | Raise the maximum, or tick Unlimited requests, on the Users page. |
Invalid TSA Request. NONCE field must be set. | Time Stamp Request must include a nonce is ticked and the request has no nonce. signtool /tr never sends one. | Untick the option, or configure the client to send a nonce. |
Invalid TSA Request. TSA Policy ID field must be set. | Time Stamp Request must include the current Time Stamp Server Policy ID is ticked and the request names no policy. | Configure the policy OID in the client, or untick the option. |
Invalid TSA Request. The TSA Policy ID is not accepted by the TSA Server (requestedOID, the server issuesOID). | The client asks for a policy that is not the Time Stamp Server Policy ID of the server. | Set the same policy in the client, or remove the policy from the client. |
request contains an extension that is not accepted (OIDs) | The request carries an extension; the server accepts none (unacceptedExtension). | Configure the client not to send extensions. |
| A refusal with the failure badAlg | The hash algorithm of the request is not accepted (for example MD5). | Use SHA-256, SHA-384 or SHA-512 in the client. |
The request is not a valid RFC 3161 time stamp request. | The body starts like an RFC 3161 request but cannot be read. | Send the request unchanged: with curl use --data-binary, not -d. |
Invalid request: the body is not an RFC 3161 or Authenticode time stamp request. (HTTP 400) | The body is neither an RFC 3161 nor an Authenticode request. | Check the client and the address. |
Invalid Authenticode time stamp request:reason (HTTP 400) | A malformed Authenticode request. | Check the client; for new signatures use RFC 3161 (signtool /tr). |
TSA Response error. | The server could not issue the time stamp (for a client the cause is not shown). | Read the last entries of the Audit Trail: usually a certificate or key that cannot be used (section 22.4). Issue a Test Time Stamp on the Configuration page shows the cause. |
The time stamp server configuration is not valid. | The accuracy saved in the database is not valid. The main page says The configuration is not valid:problemThe server refuses every time stamp request. Correct the accuracy on the Configuration page and save. | Correct Set Accuracy on the Configuration page and press Save Configuration. |
The database of the server failed its integrity check: restore a backup. | The database is damaged (section 22.1). | Restore the last good backup. |
The client signs, but signtool /t reports an error with the response | Do not encode Authenticode responses as BASE64 is ticked. | Untick it: Authenticode clients expect the Base64 form. |
22.4 The time stamp certificate
| Problem / message | Cause | Solution |
|---|---|---|
The time stamp certificate cannot be used: The system cannot find the file specified (main page) | An ECDSA key of a PFX file: Windows keeps it with CNG, and some servers (a shared web hosting) can load it neither as an ephemeral key nor as a CNG key. | Use an RSA certificate on such a server (chapter 8). |
The time stamp certificate cannot be used:reason (main page), The time stamping certificate cannot be used:reasonSelect or create the time stamping certificate. (Configuration page) | The certificate in use cannot sign: the reason follows the message. | Act on the reason (the rows below), or select or create another certificate. |
The timestamping certificate was not found in the Windows certificate store. | The selected certificate was removed from the store, or the account of the pool does not see that store (Current User is the store of that account). | Install the certificate again, with its key, or select another one (chapter 8). |
The time stamping certificate is not in the Windows certificate store any more. Select a certificate. (Select Certificate) | The same, seen on the Select Certificate page. | As above. |
The certificate does not meet the rules of a time stamping certificate:problems, or The certificate cannot be used for time stamping:problems | The certificate is not a time stamping certificate: for example The Extended Key Usage extension must contain only Time Stamping (1.3.6.1.5.5.7.3.8)., The Extended Key Usage extension must be marked as critical., The Key Usage extension must contain Digital Signature., or the key is too small. | Use a certificate made for time stamping, or create one with Create New Certificate (chapter 8). |
The time stamp certificate is expired or not yet valid (valid untildate): the server refuses every time stamp request. Select or create another certificate. | The certificate is outside its validity period (or the clock of the server is wrong). | Select or create another certificate; check the clock. |
The time stamp certificate expires ondate. Select or create another certificate before that date. | Less than 30 days of validity are left. | Renew the certificate in time. |
The private key of the certificate was not found. The certificate is installed without its private key: install it again together with the key. | The certificate in the store has no private key. | Import the PFX file (certificate and key) again. |
… The account that runs the server (account) is not allowed to use the private key of the certificate. … | The account of the pool has no right on the key. | certlm.msc (Local Machine) or certmgr.msc (Current User): the certificate, All Tasks → Manage Private Keys, add the account with Read. |
The server cannot open the private key of the certificate. The key file does not exist for the account that runs the server (account), or that account has no right to read it … | Windows reports "Keyset does not exist" or "Invalid provider type specified": the key is not in the store that was selected, or the account cannot read it. | Check that the certificate was installed with its key in the selected store, and give the account read access to the key. |
The server cannot find the file of the private key for the account that runs it (account). … | The key file was deleted, or the certificate was installed by another account. | Install the certificate again together with its private key. |
The private key needs a person to answer (a PIN or a confirmation window), and a service cannot do that. … | The key is protected so that Windows asks for a PIN or a confirmation. | Use a key without that protection, or keep the key in a PKCS#11 device (chapter 9). |
The PFX file cannot be used:reason | Wrong password, damaged file, or a file that is not a PFX. | Check the file and its password. |
Signing test failed:reason (Select Certificate, Test the Certificate) | The key cannot sign: the reason follows. | Act on the reason (rows above). For a PKCS#11 device, see chapter 9. |
The driver file does not exist:path | The path of the PKCS#11 driver is wrong. | Type the full local path of the driver .dll (chapter 9). |
Time stamping test error:reason (Configuration, Issue a Test Time Stamp) | The server could not sign with the current certificate. | Act on the reason: section 22.4 for the keys of the Windows store, chapter 9 for PKCS#11. |
The warning The time stamps are signed with SHA-1, which modern verifiers refuse … after Save Configuration | SHA-1 (legacy, not recommended) is selected as Time Stamp Response Hash Algorithm. jarsigner marks such time stamps as disabled. | Select The same as on the Time Stamp Request (minimum SHA-256) or a SHA-2 algorithm. |
22.5 Status, logs and maintenance
| Problem / message | Cause | Solution |
|---|---|---|
The daily tests have not run yet. or The last daily tests are fromtime: they have not run since (is the application pool running?). (main page) | The application pool was stopped, or the worker process was not running when the tests were due. | Check the application pool; press Run the Tests Now on the Status page. |
Public address: …: no time stamp response (status). The clients send their requests to this address. | The server cannot reach the address with which you opened the Status page (name not resolved from the server, firewall, an HTTPS certificate that the server does not accept). | Open the Status page with an address that the server itself can reach, then run the tests again. |
Public address: …: the answer is not a time stamp response (content typetype). | Something else answers at that address (a proxy, another application). | Check the address and the IIS configuration. |
Last backup: No backup was made yet (Backup and Restore page). … | No backup exists. | Make a backup and keep a copy, with secret.key, away from the server (chapter 19). |
Storage: … Keep at leastsizefree: the database and its backups grow here, and a full disk stops the logs. | Little free space on the disk of App_Data. | Free space, move old backups off the server, or shorten the retention of the response log. |
Response log: nentries were dropped since the application started: … | More responses than the log could write (often during a backup or a restore). | The time stamps were issued. Run backups and restores outside peak traffic (chapter 13). |
Audit trail: The hash chain is broken:problem | An entry of the Audit Trail was changed, inserted or deleted outside the server, or the file is damaged. | Investigate (chapter 12); keep the database for the investigation before you restore a backup. |
| The counters of the users, the response log or the main page are a few seconds behind | They are written in the background, once per interval (1 second by default). | Not a fault. |
| The time in the time stamps is not correct | The clock of the server is not synchronized. | Synchronize the clock (chapter 4). All times shown by the server are UTC. |
22.6 Verifying the time stamps
| Problem / message | Cause | Solution |
|---|---|---|
| The program that verifies the time stamp says unverified, not trusted or unknown | The time stamp certificate (or its root) is not trusted on that computer. | Install the certificate of the server, or the root of its certification authority, as trusted (chapter 16). |
openssl ts -verify fails with a certificate error | tsa.pem is not the certificate of the server, or misses the certificates of the authority. | Download the certificate again and convert it (chapter 17). |
| A verifier does not accept a time stamp signed with ML-DSA | Many clients do not verify post-quantum signatures yet. | Use an RSA or ECDSA certificate for those clients (chapter 8). |
22.7 Before you contact the technical support
Send:
- the version of the server (main page);
- the exact text of the message and a picture of the page;
- the last entries of the Audit Trail (Export CSV), and the content of
App_Data\settings\startup-error.txtif it exists; - the account and the bitness (32 or 64 bit) of the application pool;
- for a hardware device: the manufacturer and the model, the path of the driver and the result of Test the Certificate.
Source Edition: the edition built from the source code; the messages of section 22.2 and the trial messages of section 22.3 do not apply.
23. Glossary
The terms used in this manual of PKISimple TSA Server, in plain words.
23.1 Time stamps and protocols
| Term | In plain words |
|---|---|
| Time stamp | A proof, signed by a time stamping authority, that a piece of data existed at a given time. |
| TSA (Time Stamping Authority) | The service that issues time stamps. PKISimple TSA Server is a TSA. |
| Hash | A short fingerprint of data, computed with a hash algorithm (SHA-256, for example). If the data changes, the hash changes. Only the hash is sent to the server, never the file. |
| Message imprint | The hash of the data, with the name of its hash algorithm, as it appears in a time stamp request and in the time stamp. |
| RFC 3161 | The standard protocol of the time stamp services (Time-Stamp Protocol). A client sends a request with an HTTP POST and the content type application/timestamp-query; the server answers application/timestamp-reply. |
| RFC 5816 | An update of RFC 3161 that allows the TSA certificate to be identified with a hash algorithm other than SHA-1 (ESSCertIDv2). |
| RFC 9882 | The rules for using ML-DSA signatures in CMS, which the server applies to time stamps signed with an ML-DSA certificate. |
| Authenticode time stamp | The older time stamp protocol of the Windows code signing tools (signtool /t). The server answers it at the same address as RFC 3161. |
| TSQ / TSR | The file extensions used for an RFC 3161 time stamp request (.tsq, time stamp query) and for the response of the server (.tsr, time stamp reply). |
| Time stamp token (TST) | The signed part of a response: the time stamp itself. A .tsr file contains the status and the token; some tools save only the token (.tst). |
| Status (granted, rejection) | The result written in every RFC 3161 response: granted when a time stamp was issued, rejection with a failure code and a text when it was refused. |
| Failure info | The code of a refusal in an RFC 3161 response, for example badAlg (hash algorithm not accepted), badRequest, badDataFormat, unacceptedPolicy, unacceptedExtension, timeNotAvailable or systemFailure. |
| genTime | The time written in an RFC 3161 time stamp: the UTC time of the server when it signed. |
| Serial number (of a time stamp) | A number that identifies each RFC 3161 time stamp issued by the server. |
| Nonce | A random number put in the request and copied into the time stamp, so that the client can match the response with its request and detect a replayed response. |
| Policy ID, policy OID | An identifier (OID) of the policy under which the time stamp is issued. The server writes its Time Stamp Server Policy ID in every time stamp. |
| OID (object identifier) | A dotted number that names an algorithm, a policy or an extension, for example 1.3.6.1.5.5.7.3.8 (Time Stamping). |
| Accuracy | An optional field of a time stamp that states how far the time can be from the exact UTC time. |
| Ordering | An optional field of a time stamp; when true, the time stamps of the server can be ordered by their time regardless of the accuracy. |
| certReq | The flag of a request that asks the server to include its certificate in the time stamp. |
| Extension (of a request) | Additional data in a request. The server accepts no request extensions. |
| ESSCertID, ESSCertIDv2 | The signed attribute that binds a time stamp to the certificate that signed it. ESSCertID uses SHA-1 (RFC 3161, legacy); ESSCertIDv2 uses the hash algorithm of the signature (RFC 5816) and is the default of the server. |
| qcStatements | An extension that, in a time stamp, declares it a qualified electronic time stamp (ETSI EN 319 422, eIDAS). The server adds it only when the option is ticked. |
| eIDAS | Regulation (EU) No 910/2014 on electronic identification and trust services. |
| CMS, PKCS#7 | The format of signed data on which RFC 3161 time stamps, Authenticode time stamps and CAdES signatures are built. |
| CAdES, PAdES, XAdES, ASiC | The European formats of advanced electronic signatures for any file, for PDF documents, for XML and for signature containers. Their levels with time stamps (-T, -LT, -LTA) use a TSA. |
| LTA (long-term archival) | A signature level that adds validation data and archive time stamps, so that the signature can be validated for many years. |
23.2 Certificates and keys
| Term | In plain words |
|---|---|
| Time stamp certificate (TSA certificate) | The certificate of the server, with the extended key usage Time Stamping (critical) as its only purpose. Its private key signs the time stamps. |
| Extended Key Usage | The extension of a certificate that lists what the certificate can be used for. |
| Self-signed certificate | A certificate signed with its own key: it is its own root, so a verifier must install it as trusted. The certificate created at the installation is self-signed. |
| Root certificate, chain | The certificate at the top of a chain of certificates. A computer trusts a certificate when it trusts the root of its chain. |
| PFX / P12 | A file that holds a certificate and its private key, protected by a password. |
| Certificate store | The place where Windows keeps certificates. Current User is the store of an account; Local Machine is the store of the computer. |
| Thumbprint | The hash of a certificate. It identifies a certificate in a store. |
| RSA, ECDSA | The classic signature algorithms of certificates. RSA works with every client; ECDSA (P-256 or larger) is faster. |
| ML-DSA | A post-quantum signature algorithm (FIPS 204). Time stamps signed with it are verified by few clients yet. |
| CNG, CSP, KSP | The components of Windows that manage private keys: Cryptographic Service Provider (older) and Key Storage Provider (CNG, newer). |
| HSM | Hardware Security Module: a device that keeps private keys and signs inside it. The key never leaves it. |
| PKCS#11 | The standard way for a program to use the keys of an HSM, of a smart card or of a token, through a driver (library) of the manufacturer. |
| Slot | In PKCS#11, a place where a device (or a partition of an HSM) is connected. |
| PIN | The secret with which the server logs in to the PKCS#11 device as its normal user. |
| Middleware | The software that comes with a smart card or a token and lets programs use it. |
23.3 Server and storage
| Term | In plain words |
|---|---|
| IIS | Internet Information Services, the web server of Windows, in which the server runs. |
| Application pool, identity | The IIS process in which the server runs, and the Windows account under which it runs. The rights of the server are the rights of this account. |
| Worker process, web garden | The process of an application pool. An application pool with more than one worker process is a web garden. |
| IIS_IUSRS | A local group of Windows to which the accounts of the application pools belong. |
| SQLite | The database engine of the server. All the data is in one file, App_Data\settings\tsa.db; no database server is needed. |
| WAL (write-ahead logging) | The journal mode of the database: changes are written first to tsa.db-wal and copied into tsa.db later (checkpoint). It lets requests read while others write; it requires a local disk. |
| Integrity check | The check of the whole database file that the server runs at the start and in the daily tests. |
secret.key | The installation secret, in App_Data\settings. It protects the passwords, the PIN and the keys stored in the database; a backup cannot be restored without it. |
| Audit Trail | The log of the events of the server. Each entry is chained to the previous one by a SHA-256 hash, so that a changed, inserted or deleted entry is detected. |
| Response log | The optional log of every response of the server (Log all responses). |
| UTC | Coordinated Universal Time. All the times shown by the server are UTC. |
| (S)NTP | The protocol that synchronizes the clock of a computer with a time server. |
| Basic authentication | An HTTP way to send a user name and a password in the header Authorization. |
| Percent-encoding | The way to write special characters in an address, for example & as %26. |
24. Warning and disclaimer, trademarks
24.1 Disclaimer
Every effort has been made to make this manual of PKISimple TSA Server 7.6 as complete and accurate as possible, but no warranty or fitness is implied. The information is provided on an "as is" basis. The author shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this manual.
The use of the software is governed by its license agreement, the file License Agreement.txt of the installation package (the licensed edition also shows it at the first start). In case of any difference between this manual and the License Agreement, the License Agreement prevails. In short, and without replacing its text:
- The software is provided "as is", without warranty; the License Agreement limits the liability of Secure Soft (its sections 8 and 9).
- The time stamps issued with the software are not qualified electronic time stamps within the meaning of Regulation (EU) No 910/2014, and the software does not make its user a qualified trust service provider. The software does not certify or guarantee the legal effect of any time stamp (section 5.2).
- The certificates that the software creates are self-signed test certificates. They are not validated, verified or accredited by Secure Soft or by any third party, and they must not be used for time stamps on which third parties rely (section 5.3).
- The user who installs and operates the server is responsible for it: the time stamp certificate and its private key, the clock of the server, the configuration, security, availability and backups, the time stamping policy and the compliance with the laws and standards that apply, and the use made of the time stamps (section 5.1).
- The software sends no data to Secure Soft; the user is the controller of the personal data that the server records, such as user names and IP addresses in its logs (section 6).
Source Edition: the package TSAServer-SourceEdition.zip contains the same License Agreement.txt, but the server does not show it at the first start.
24.2 Third-party components
PKISimple TSA Server contains third-party components (among them Bouncy Castle, Pkcs11Interop, Bootstrap, Microsoft.Data.Sqlite, SQLitePCLRaw and SQLite), each under its own license. The list, the licenses and the required notices are in the file THIRD-PARTY-NOTICES.txt and in the section OTHER LICENSES of License Agreement.txt.
24.3 Trademarks
.NET, Windows, Windows Server, IIS, Authenticode, PowerShell, signtool and Microsoft Office are trademarks of Microsoft Corporation. Adobe, Acrobat and Reader are trademarks of Adobe Inc. Java is a trademark of Oracle and/or its affiliates. All other trademarks are the property of their respective owners.
24.4 About this manual
PKISimple TSA Server 7.6 · User Manual. The examples use the address https://tsa.example.com/tsa/get.aspx, which stands for the address of your server. The names of the menus and windows of Windows and of other programs can differ slightly on your computer.
The pictures of the pages of the server were taken from a test installation of version 7.6 with demonstration data. The pictures of IIS Manager, of the Windows dialogs and of the time synchronization tool come from earlier versions of the documentation and can differ slightly on your computer.
Secure Soft SRL, 4 Vasile Conta, Piatra Neamt 610115, Romania · office@tsaserver.com · https://tsaserver.com