EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Read timestamp server error code

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
Posted: 05/15/2013 09:23:30
by Lukas Vyslouzil (Standard support level)
Joined: 08/21/2009
Posts: 20


I use this timestamp url: https://www.postsignum.cz/TSS/TSS_user/. It requires user/password authentication. If a wrong user password combination is inserted, TSP servers returns error response. My problem is that I can't recognize error response. I am not able to find any error code or message. Could you help me find this out? To communicate with TSP server I use common classes like TElHTTPTSPClient or TElHTTPSClient. Thank you.
Posted: 05/15/2013 15:14:41
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

You should use TElHTTPTSPClient.OnHTTPError event handler with TElHTTPTSPClient.Timestamp return code to find out the error code. The first one is used to detect errors on HTTP protocol level. The second one is used to detect TSP protocol errors.
Posted: 05/16/2013 09:27:38
by Lukas Vyslouzil (Standard support level)
Joined: 08/21/2009
Posts: 20

But I don't call TElHTTPTSPClient.Timestamp method directly so I can't read its return code. I timestamp PDFs so in my case I set TElPDFPublicKeySecurityHandler.TSPClient property and close document. I assume TElHTTPTSPClient.Timestamp method is called when TElPDFDocument.Close(true) method is invoked. In fact, it would be very usefull to get TSP server response before document is closed. So, may I call TElHTTPTSPClient.Timestamp method and then close PDF? Is this an alternative correct way how to timestamp PDF? Thank you.
Posted: 05/16/2013 09:33:05
by Vsevolod Ievgiienko (EldoS Corp.)

In this case TSP error code is returned with the thrown exception and can be read via its ErrorCode property.
Posted: 06/01/2013 07:43:00
by Lukas Vyslouzil (Standard support level)
Joined: 08/21/2009
Posts: 20

I tried to add a document timestamp to a PDF, but no exception was thrown while document closing. It works if I create a new signature with signature timestamp but not if I create a new document timestamp.
Could you try to create a document timestamp using this tms url? - https://teszt.e-szigno.hu:440/tsa2
The valid name/pass is teszt/teszt, but if you insert an invalid name or password, you will see no exception is thrown. Thank you.
Posted: 06/01/2013 07:48:57
by Eugene Mayevski (EldoS Corp.)

Please show a code snippet that illustrates how you are using the components now.

Sincerely yours
Eugene Mayevski
Posted: 06/25/2013 10:00:50
by Lukas Vyslouzil (Standard support level)
Joined: 08/21/2009
Posts: 20

To create a document timestamp I use following code:
TElPDFDocument doc = new TElPDFDocument();

int idx = doc.AddSignature();
TElPDFSignature docSig = doc.get_Signatures(idx);
TElPDFAdvancedPublicKeySecurityHandler docSigHandler = new TElPDFAdvancedPublicKeySecurityHandler();
docSigHandler.PAdESSignatureType = TSBPAdESSignatureType.pastDocumentTimestamp;
docSigHandler.CustomName = "Adobe.PPKMS";
docSig.Handler = docSigHandler;

TElHTTPSClient HTTPClient = new TElHTTPSClient();            
HTTPClient.RequestParameters.Username = "name";
HTTPClient.RequestParameters.Password = "pass";
TElHTTPTSPClient TSPClient = new TElHTTPTSPClient();
TSPClient.HTTPClient = HTTPClient;
TSPClient.HashAlgorithm = SBConstants.Unit.SB_ALGORITHM_DGST_SHA256;
TSPClient.URL = "https://www.postsignum.cz/TSS/TSS_user/";

docSigHandler.TSPClient = TSPClient;
docSig.SigningTime = utcNow;
docSig.Invisible = true;


The above code works perfect if valid name and password are passed. But if not (like that above), no exception is thrown from doc.Close method. If I use similar code to create a signature timestamp, not document timestamp, the exception is thrown from doc.Close method if wrog name/pass is passed.
Posted: 06/25/2013 10:03:44
by Eugene Mayevski (EldoS Corp.)

As discussed before, we've added a new event to the TSP client, to track errors of this kind. The event will be available in the next build of SecureBlackbox 11.

Sincerely yours
Eugene Mayevski
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages



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