I have several timestamp token files that I think should have TSA certificates embedded within them because the "Request TSA certificate" option was selected when I requested them with TimeStampClient. Now I want to verify them with openssl with a command line like this:

openssl.exe ts -verify -data file.zip -in token.tst -token_in -CAfile certificate.cer

So I need the certificates. BTW I think that for real verification I should not get the certificates from the token files themselves (because they can be fake/self signed?) if the files were from an untrusted party.

BTW can you please tell me a way to get the TSA timestamp certificate from its server via RFC 3161 protocol? Some servers like time.certum.pl does not provide a straightforward link to it at that web address.


An RFC3163 response does not necessarily contain the signing certificate itself. It contains a SignedData structure, which is described in RFC5652 thusly:

  SignedData ::= SEQUENCE {
    version CMSVersion,
    digestAlgorithms DigestAlgorithmIdentifiers,
    encapContentInfo EncapsulatedContentInfo,
    certificates [0] IMPLICIT CertificateSet OPTIONAL,
    crls [1] IMPLICIT RevocationInfoChoices OPTIONAL,
    signerInfos SignerInfos }

  DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier

  SignerInfos ::= SET OF SignerInfo

The certificates field is optional, whereas the signerInfos field is not. A SignerInfo structure is defined as follows:

SignerInfo ::= SEQUENCE {
  version CMSVersion,
  sid SignerIdentifier,
  digestAlgorithm DigestAlgorithmIdentifier,
  signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL,
  signatureAlgorithm SignatureAlgorithmIdentifier,
  signature SignatureValue,
  unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL }

The sid field contains a unique identifier for the signer, which can be traced back to the certificate which signed it.

There is no standardised way to retrieve the certificate outside the certificates field of the SignedData structure. If it is not provided in that field, the TSA must provide it out of band. How exactly that is done is up to the TSA.

  • Can a TSA certificate be self-signed? – user273084 Sep 6 '17 at 4:11
  • @user273084 The certificate installed on the server to sign TSA requests can be self-signed, yes. It provides no security though, unless it's self-signed in the sense of using an internal CA for your organisation. – Polynomial Sep 6 '17 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.