EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Java - JNI

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#28771
Posted: 03/13/2014 06:20:09
by glinttgs sousa (Basic support level)
Joined: 02/27/2014
Posts: 51

Hi Eldos,

I have 2 questions for you.

First: I'm getting this exception - «Exception in thread "main" java.lang.UnsatisfiedLinkError: no sbbjni64.dll in java.library.path»

How do I put in java.library.path the dll? I've tried several ways, including put the dll in a folder and then change "Native Library Location" workspace to that folder, but still no luck.

Second: The fact of using JNI, will allow me to export the java project as an applet and use it on javascript? I want the applet may be used in Linux and MACOSx as well. Is this possible?

Thank you for your attention,

My best regards,
Will.
#28774
Posted: 03/13/2014 06:42:31
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Quote
How do I put in java.library.path the dll? I've tried several ways, including put the dll in a folder and then change "Native Library Location" workspace to that folder, but still no luck.

java.library.path depends on the OS. You can read it using next code:

Code
String path = System.getProperty("java.library.path");


or simple set to any directory using java parameters:

Code
java -Djava.libarary.path=<path_to_dll> ...


Also you may call JNI.initialize("path_to_dll") overload and pass a full path to the DLL as its parameter.

Quote
Second: The fact of using JNI, will allow me to export the java project as an applet and use it on javascript? I want the applet may be used in Linux and MACOSx as well. Is this possible?

Currently JNI module works only for Windows.
#28791
Posted: 03/17/2014 05:26:29
by glinttgs sousa (Basic support level)
Joined: 02/27/2014
Posts: 51

Ok, thanks for the java.path explanation.

If only works for Windows, why your SecBBoxJava Sample uses it? It's supposed to work for Android also, right? Does Android reads JNI?
#28792
Posted: 03/17/2014 05:32:00
by Eugene Mayevski (EldoS Corp.)

For Android or other constrained platform you'd need to remove some parts of the sample.

What exactly sample are you testing?


Sincerely yours
Eugene Mayevski
#28793
Posted: 03/17/2014 05:33:09
by Vsevolod Ievgiienko (EldoS Corp.)

Android supports JNI, but our JNI module works only for Windows.
#28794
Posted: 03/17/2014 05:36:02
by glinttgs sousa (Basic support level)
Joined: 02/27/2014
Posts: 51

I'm testing the XMLBlackBox and the OfficeBlackBox sample.
These ones came with the secbboxjava.zip
/secbboxjava/Samples/XMLBlackBox for example is the path of the XMLBlackBox that uses JNI.initialize();

How do I know if it is mandatory to use JNI or not? I didn't want to use it, because I want my Java App works on Linux, MAC OSx and Android as well...

Thank you very much for your reply.
#28795
Posted: 03/17/2014 05:38:53
by Eugene Mayevski (EldoS Corp.)

JNI is not mandatory, but as signing the documents using certificates in Windows certificate storage is the popular operation, we had to include it. Please comment it out for now, and we'll improve the sample to check for the OS.


Sincerely yours
Eugene Mayevski
#28796
Posted: 03/17/2014 05:39:40
by Vsevolod Ievgiienko (EldoS Corp.)

You should simply remove JNI.initialize() line and the samples will work without JNI support.

Without JNI you will not be able to use PKCS#11 and TElWinCertStorage class.
#28797
Posted: 03/17/2014 05:42:38
by glinttgs sousa (Basic support level)
Joined: 02/27/2014
Posts: 51

Oh ok, I thought the JNI was being used to perform the digital signing operations and not to get the Windows Storage Certificates. Thus, I'm able to use the sample, by passing a certificate as a parameter.

Once again, thanks a lot for all your helpfulness.
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

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