EldoS | Feel safer!

Software components for data protection, secure storage and transfer

how to read a tsp timestamp from a pdf document

Posted: 08/28/2009 09:56:51
by Christoph Moar (Standard support level)
Joined: 08/28/2009
Posts: 46

I managed to sign and timestamp a pdf document with your toolkit just fine.

Now, a second part of the application, will later re-open the pdf document and loop over the signatures and timestamps and display them for the user.

I managed to loop over all signatures and display their relevant data, but whenever I try accessing the timestamp, it does return zero timestamps.
If I open the document in acrobat, it correctly shows the signature has been timestamped.

The pseudocode is:

// is the document signed
int aPdfSignatureCount = aPdfDocument->SignatureCount;
for(int i=0; i<aPdfSignatureCount; i++)
TElPDFSignature* aSignature = aPdfDocument->Signatures[i];
TElPDFSecurityHandler* aHandler = aSignature->Handler;
TElPDFPublicKeySecurityHandler* aPublicKeyHandler =
dynamic_cast<TElPDFPublicKeySecurityHandler*> (aHandler);
int aPublicKeyTimestampCount = aPublicKeyHandler->TimestampCount;

---> this is always zero, i never get any timestamps

// return value
aRetVal = 0;

What am I doing wrong? I do not want to check if the timestamps are valid or whatever - the user should do that later when opening it in acrobat. But I do want to display if a specific signature has been timestamped or not (and maybe a few details of the timestamp itself).

Can this be accomplished? The API looks like it should, I just don't get why it always returns an empty timestamp structure.
Posted: 08/28/2009 10:15:35
by Christoph Moar (Standard support level)
Joined: 08/28/2009
Posts: 46


i finally found it out myself while writing the forum entry above :)

I do have to call certificate->validate().
Only after that call, the timestamp structure is setup.

thanks anyways ;)



Topic viewed 1218 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!