Download OpenAPI specification:Download
Our qualified Timestamping service lets you prove that a piece of data existed and has not been modified since a specific moment in time. The service is qualified under the European regulation 910/2014 (eIDAS).
It gives you a simple way to add a timestamp that irrefutably guarantees the existence at the time of stamping, and the integrity from that moment on, of documents and transactions.
Two Timestamping Authorities are available with the same legal validity, both issuing eIDAS qualified timestamps:
| Authority | Request URL | Credits per timestamp |
|---|---|---|
| MENSATEK | https://api.mensatek.com/tsaMENSATEK | 1 credit |
| FNMT (Fábrica Nacional de Moneda y Timbre) | https://api.mensatek.com/tsaFNMT | 2 credits |
If the chosen authority does not respond, the request is automatically served by the other one, at the price of the URL you called. The TSA field of the timestamp shows which authority issued it.
Simply issue requests following the IETF-PKIX RFC-3161 timestamp standard -Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)- with the following characteristics:
HTTPS POST request with Content-Type application/timestamp-query and the binary timestamp request as the body (.tsq file).
A HASH of the data is sent; the supported algorithms are SHA256, SHA384 and SHA512.
The response is binary, with Content-Type application/timestamp-reply (.tsr file).
Do not set a policy in the request (reqPolicy): each authority applies its own (see Other technical data).
Only granted timestamps are charged: if the request is wrong or the service does not respond, no credits are deducted.
The service requires a registered user account that has purchased credits at least once. Authentication can be:
1.- With username and password (HTTP Basic authentication, BASIC AUTH). You will find them in your user panel, Timestamping section; they work for both URLs and only the account holder can use them. Just send the Authorization header with each request: no fixed IP address or client certificate is needed.
2.- With a certificate. The certificates to be used are also validated from your user panel; the request URL for certificate authentication is https://cert.asetecgroup.es/tsa (FNMT timestamp, 2 credits).
Timestamping takes the following steps:
Step 1: HASH generation
Create the HASH of the document or data to stamp; any function available in any programming language will do. In this example we build the request with openssl:
openssl ts -query -data myfile.pdf -no_nonce -sha256 -out request.tsq
Running this command produces a request.tsq file containing everything needed for the request to the TSA (Timestamping Authority). To use SHA-512, replace -sha256 with -sha512. If you add -cert, the timestamp will include the authority's certificate, which most validators need.
NOTE: if what you want is to timestamp a PDF file and also 'embed' the timestamp (and optionally a signature) into the document itself, use the PDF Signing and Timestamping utility we have built to help our customers, which performs the whole process.
Step 2: Timestamp request
With the request.tsq file from the previous step (TSQ: TimeStamp Query) we send a request to the chosen TSA server:
// MENSATEK timestamp (1 credit)
curl -H 'Content-Type:application/timestamp-query' --data-binary @request.tsq https://api.mensatek.com/tsaMENSATEK -o response.tsr -u user:password
// FNMT timestamp (2 credits)
curl -H 'Content-Type:application/timestamp-query' --data-binary @request.tsq https://api.mensatek.com/tsaFNMT -o response.tsr -u user:password
The response.tsr file contains the timestamp for the data we sent.
Step 3: Timestamp verification
openssl ts -reply -in response.tsr -text
We will get a reply like the following (in this example, an FNMT timestamp):
Status info:
Status: Granted.
Status description: unspecified
Failure info: unspecified
TST info:
Version: 1
Policy OID: 0.4.0.2023.1.1
Hash Algorithm: sha256
Message data:
0000 - d5 86 97 15 3e bd 4d 5c-f6 56 61 49 16 95 88 4e ....>.M\.VaI...N
0010 - c6 f2 c5 0f b3 be 2b 57-fd 93 3c d8 47 14 e5 3a ......+W..<.G..:
Serial number: 0x467819383180ADD560EC8A3B171A7B29
Time stamp: Jul 12 18:30:19.06 2021 GMT
Accuracy: unspecified seconds, 0x64 millis, unspecified micros
Ordering: no
Nonce: unspecified
TSA: DirName:/C=ES/O=FABRICA NACIONAL DE MONEDA Y TIMBRE-REAL CASA DE LA MONEDA/OU=CERES/2.5.4.97=VATES-Q2826004J/CN=AUTORIDAD DE SELLADO DE TIEMPO FNMT-RCM - TSU 2016
Check the HTTP status and the Content-Type before storing the response: the text of error responses may vary.
| HTTP status | Meaning | Charged? |
|---|---|---|
| 200, application/timestamp-reply | Timestamp granted. | Yes |
| 200, application/timestamp-reply, status "rejection" | The authority could not grant the timestamp (for example, a policy it does not support was requested). | No |
| 400 | The body is not an RFC 3161 timestamp query (binary .tsq file, not base64). | No |
| 401 | Authentication is missing, or the username or password is wrong. | No |
| 402 | The account has never purchased credits, or does not have enough credit. | No |
| 405 | The request is not a POST. | No |
| 503 | The service is temporarily unavailable: retry after the number of seconds given in the Retry-After header. | No |
Data not needed for the integration:
MENSATEK authority
Timestamp policy (TSA policy): OID 0.4.0.2023.1.1 (ETSI EN 319 421 best practices policy).
Timestamps carry the esi4-qtstStatement-1 extension (OID 0.4.0.19422.1.1), which identifies them as qualified timestamps.
FNMT authority (Fábrica Nacional de Moneda y Timbre)
Download link of the root certificate of the FNMT TSA (Fábrica Nacional de Moneda y Timbre): Download
Policy reference/OID: 1.3.6.1.4.1.5734.3.18.1
Associated policy type: QCP-l. OID: 0.4.0.194112.1.1