Skip to content

Archives and re-stamping

A time stamp proves that a document existed at the moment of the time stamp. That proof rests on the certificate the service signed the time stamp with and on the hash algorithm (SHA-256). The certificate has an expiry date, and algorithms grow weaker over time. For a long-term archive the time stamp must therefore be renewed: before it weakens, a new time stamp confirms both the document and all the earlier time stamps.

For documents you sign with the AdES web API, choose level LTA (see Signature levels and time stamps). The signature then holds the data for long-term validation and an archive time stamp, all inside the document itself.

Keep the service’s response (.tsr) with the file, under the same name (document.pdf and document.pdf.tsr). After stamping, the file must not change by a single byte: the time stamp is valid only for exactly that content.

Every time stamp holds the certificate of the service that issued it (if you sent the request with -cert or certReq). You can check the certificate’s expiry date as follows:

Prozor terminala
openssl ts -reply -in document.pdf.tsr -token_out | openssl pkcs7 -inform DER -print_certs | openssl x509 -noout -subject -enddate

Request a new time stamp well before that date, and earlier if the hash algorithm is no longer considered secure.

Request the new time stamp for the document together with all the earlier time stamps, so that it confirms them too:

Prozor terminala
cat document.pdf document.pdf.tsr | openssl ts -query -sha256 -cert -out renewal.tsq
curl --fail -u 'USER_NAME:PASSWORD' \
-H 'Content-Type: application/timestamp-query' \
--data-binary @renewal.tsq \
-o document.pdf.2.tsr \
'SERVICE_ADDRESS'

At the next renewal, add document.pdf.2.tsr to the input as well, always in the same order. Keep all the time stamps and record the order in which you joined them: without it the chain cannot be verified. For larger archives the same principle applies to groups of documents (an evidence record as in RFC 4998).

You verify a time stamp with the certificate chain of AKD’s time-stamping service, for example:

Prozor terminala
openssl ts -verify -data document.pdf -in document.pdf.tsr -CAfile akd-tsa-chain.pem

Verification: OK means that the time stamp belongs to that document and that a service from the chain signed it. AKD is a qualified trust service provider, so its services and certificates are also listed in the EU Trusted List.