EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How Distributed Cryptography Java applet works?

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#28289
Posted: 02/06/2014 18:09:10
by Jorge Martins (Standard support level)
Joined: 02/06/2014
Posts: 9

Hi,

I'm not fully understanting how the Distributed Cryptography Java applet works.

Basically what I need is to sign documents that are on a server using a card that is on the client.

I tried to recreate the example as show in the documentation (https://www.eldos.com/documentation/sbb/documentation/ref_dc_java.html) but i'm not really understanding what to put in the "Data" and "DataURL" params.

Is the DataURL a URL on the server that catches the signature, and then uses that signature to sign the document on the server side?

What is the "Data" params? The documentation referes to a TElDCAsyncState wich is included on the Package: SecureBlackbox.DC.jar but my version of this package doeen't include this class (i've downloaded the java trial)


Can you explain the workflow when using the java applet?
Is it possible to include a real example wth server/client side?

Thanks
#28291
Posted: 02/07/2014 00:30:51
by Alexander Ionov (EldoS Corp.)

Thank you for contacting us.

By now the flow is as following:
1. You presign a document with the public user certificate by calling TElPDFDocument.InitiateAsyncOperation or TElXMLSigner.InitiateAsynSign.
2. Save the returned async state into the Data parameter.
3. The user signs the data with his/her private key and returns the result to the specified DataURL.
4. You complete signing of the document started at step 1 using the returned data.

Unfortunatelly we have only VCL and C# examples for DC by now.


--
Best regards,
Alexander Ionov
#28406
Posted: 02/13/2014 15:14:20
by Jorge Martins (Standard support level)
Joined: 02/06/2014
Posts: 9

Hi,

I'm evaluating this packages for a possible purchase, but I really need to be able to put a demonstration using the Distributed Cryptography Java applet in Java.

I been trying to replicate the C# example to Java (Tomcat + Servlets + JSP)
But i'm currently blocked on the final part of the signature workflow.

On the C# sample on the FinishSigning Method you have the following code

Code
MemoryStream input = new MemoryStream(signature);
state.LoadFromStream(input, SBDCXMLEnc.__Global.DCXMLEncoding());


Java doesn't have a MemoryStream implementation like C# and also the LoadFromStream Method in Java only accepts TElStream objects.

I Tried the following code:

Code
TElStream input = null;
input.Write(signature, 0, signature.length);
state.LoadFromStream(input, SBDCXMLEnc.DCXMLEncoding());    


and also with the Read method

Code
input.Read(signature, 0, signature.length);


But I always get a java.lang.NullPointerException error.

Can you give me some lights on how to implement this last part, since there's no Java example.

Thank You.
#28407
Posted: 02/13/2014 19:54:38
by Jorge Martins (Standard support level)
Joined: 02/06/2014
Posts: 9

Hi,

It didn't strike me at that moment, but I manage to solve the problem by using TElFileStream instead of TElStream :)

Thank You.
#28409
Posted: 02/14/2014 01:05:33
by Vsevolod Ievgiienko (EldoS Corp.)

Quote
It didn't strike me at that moment, but I manage to solve the problem by using TElFileStream instead of TElStream :)

You can use TElMemoryStream in Java. Its an analogue of MemoryStream in .NET.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

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