EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TSP Server

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
Posted: 08/27/2007 11:09:10
by Erick Archila Moreno (Basic support level)
Joined: 08/17/2007
Posts: 8

Hi, I´m trying to implemente an TSP Server, in the corresponding How to Article describes steps tos process the request on the server, but ´when return the response to then cliente, the method timestamp of cliente devolves an 83973 error "Invalid response data", the property Time of ElCustomTSPServer is "01/01/0001 12:00:00 am", the error is for this?, How can I set the Time property?, I use the set_Time method from TSPInfo property, but the Visual Studio Sars: "cannot explicitly call operator or accessor". I'm using the Evaluate Version, thanks for yout time.
Posted: 08/27/2007 13:29:15
by Ken Ivanov (EldoS Corp.)

Thank you for your message.

Would you be so kind to post the code you are using to the forum, so that we could try to find the reason for the problem you are encountering?
Posted: 08/28/2007 01:58:18
by Eugene Mayevski (EldoS Corp.)

This is a known problem in some programming languages that's solved with build 117 or 118 (I can't check at the moment). So

1) take the latest build
2) cast the instance of TSPInfo to ElServerTSPInfo
3) ElServerTSPInfo has a special setter method (SetTime if memory serves) that lets you set the time.

Sincerely yours
Eugene Mayevski
Posted: 08/28/2007 12:45:01
by Erick Archila Moreno (Basic support level)
Joined: 08/17/2007
Posts: 8

Thanks the problem with the Set Time property was resolved with the Build 118, but i have the problem with error 83973 results from TElCustomTSPClient.TimeStamp, instance from TElFileTSPClient, the code is below:

//Client Code
TSPClient.HashAlgorithm = SBConstants.Unit.SB_ALGORITHM_DGST_MD5;
TSPClient.IncludeCertificates = true;
//Obtain MD5 message hash
hash = ObjHash.BytesHash(Mensaje);
//require the TimeStamp
result = TSPClient.Timestamp(hash, out serverResult, out Error, out Respuesta);
//the TspClient.Timestamp returns 83973 value, in documentation "invalid response data"

//Server Code
//Create the object for response
sResp = new MemoryStream();
//Load the request from Stream
res= TSPSvr.LoadRequestFromStream(req);
// Set the serial number property
TSPSvr.TSPInfo.SerialNumber = SBUtils.Unit.BytesOfString(lSecuencial.ToString("00000000000000000000"));
//Set NameServer (optional)
TSPSvr.TSPInfo.TSANameSet = true;
TSPSvr.TSPInfo.TSAName.DNSName = "TSPNotary";
//Cast the instance and call set_Time metthod with Date Now
//Load Certificate to sign the response
if (CargaCertificado(ref CertStorage, ref ErrMsg) != 0) return null;
if (result != 0)
ErrMsg = "Error";
sResp = null;
//Asign the certificate to sign and save the response
TSPSvr.Certificates = CertStorage;
if (!TSPSvr.SaveReplyToStream(1, 0, req)) return null;
//Save the time of the timestamp in a local variable
lfecha = TSPSvr.TSPInfo.Time;

I hope, you can help me, thanks for you time.
Posted: 08/28/2007 12:49:59
by Erick Archila Moreno (Basic support level)
Joined: 08/17/2007
Posts: 8

Excuse me, in the line
if (!TSPSvr.SaveReplyToStrea­m(1, 0, req)) return null;

change with this
if (!TSPSvr.SaveReplyToStrea­m(1, 0, sResp)) return null;

the result is the same. Thanks
Posted: 08/29/2007 02:12:37
by Eugene Mayevski (EldoS Corp.)

Please try to create a small test case (complete) which we can compile) and include your certificate with key there. Then submit the test case to the HelpDesk (http://www.eldos.com/support/ticket_list.php)

Sincerely yours
Eugene Mayevski
Posted: 08/29/2007 11:45:51
by Erick Archila Moreno (Basic support level)
Joined: 08/17/2007
Posts: 8

Hi, I try find the link (http://www.eldos.com/sup­port/ticket_list.php) but the sites says than the resource is not found, i this message attach a zip file with the test proyect, I hope you can tell me what is the problem, thanks for yout rime


[ Download ]
Posted: 08/31/2007 09:05:48
by Ken Ivanov (EldoS Corp.)

There is an error in your code. Inside the OnTimestampNeeded handler you should put the output data to the passed (existing) ReplyStream object rather than assign your stream object to the ReplyStream variable. Please replace the following line:

ReplyStream = ProcessReqTSP(ref RequestStream, ref MsgError);


Stream serverReply = ProcessReqTSP(ref RequestStream, ref MsgError);
byte[] tmpBuf = new byte[serverReply.Length];
serverReply.Position = 0;
serverReply.Read(tmpBuf, 0, tmpBuf.Length);
ReplyStream.Write(tmpBuf, 0, tmpBuf.Length);
ReplyStream.Position = 0;

This should solve the problem.
Posted: 08/31/2007 09:52:40
by Erick Archila Moreno (Basic support level)
Joined: 08/17/2007
Posts: 8

The code than you posted resolved the problem, thanks Innokentiy and I hope don't have more dudes.

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.



Topic viewed 3145 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!