EldoS | Feel safer!

Software components for data protection, secure storage and transfer

accessing the timestamp in a pkcs#7 *.tsr file

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#12212
Posted: 01/27/2010 07:45:19
by Christoph Moar (Standard support level)
Joined: 08/28/2009
Posts: 46

Seems like today is my forum day. Sorry, I hope my questions are of help for others, too. The next issue I came around is the following:

I have
- a container with a document and its signatures (*.p7m) file
- a detached timestamp (*.tsr) file which basically signs and timestamps the p7m file

I would like to read in the *.tsr file, loop over the signatures in there and display some timestamp information.

So my approach would be:
1. MIME decode the tsr file
2. TElSignedCMSMessage and Open() the tsr file (do as if this is a p7s file)
3. For each Signature in there
4. Get the timestampCount
5. For each timestamp in there
6. Get the TElClientTSPInfo to retrieve all timestamp informations.

I believe this should be correct?
The problem is that these *.tsr files are somewhat different from a normal *.p7s file? The old toolkit I was using had special methods for opening and inspecting them. I attach one of these timestamp files, maybe you can point me into the right direction?

Thanks!
#12213
Posted: 01/27/2010 07:49:42
by Christoph Moar (Standard support level)
Joined: 08/28/2009
Posts: 46

The following zip archive contains:

- the sample p7m file (a document + signatures)
- the tsr file (=signature of p7m file + timestamp)
- the tsr file mime-decoded (*.tmp)


Wait, now I see: maybe I should use
ElClientTSPInfo.ParseCMS?


[ Download ]
#12215
Posted: 01/27/2010 09:30:46
by Christoph Moar (Standard support level)
Joined: 08/28/2009
Posts: 46

Hmmm. It still does not work.
I instantiate a TElFileTSPClient object.

Then i use aMessage->TSPInfo->ParseCMS(aArray) to read in the *.tsr file I have containing the timestamp response.

The method seems to process things for a few seconds, then it returns -1 and the tspinfo object does not contain any useful data.

Can you hint me as to what I am doing wrong here?
What is error code -1 on ParseCMS() meaning?
Why can't I read a *.tsr file this way?

Thanks,
Christoph
#12216
Posted: 01/27/2010 09:45:30
by Ken Ivanov (EldoS Corp.)

You can pass the timestamp contained in the T000003356.TXT.p7m.tsr.tmp file to the constructor of TElCMSTimestamp class:

TSP := TElCMSTimestamp.Create(nil, BufTSP);

Then you can browse the information contained in the timestamp using the properties of TElCMSTimestamp object.
#12223
Posted: 01/27/2010 15:01:45
by Christoph Moar (Standard support level)
Joined: 08/28/2009
Posts: 46

Thanks, that was the solution.
Your library is so extensive that the only hard part is finding the right approach sometimes ;)

regards,
christoph
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

Topic viewed 3297 times

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




|

Back to top

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

Got it!