Register / Login  |  Desktop view  |  Jump to bottom of page

General Issues » JCAPIUtil.getCSPs() fails with java.lang.UnsatisfiedLinkError

Author: lolo12, Visitor
26/09/2012 17:19:33
Hi All,

I downloaded JCAPI and was trying to get it to work - unsuccessfully...

Details below...

Code :
package com.mnu.cryptocard;

import com.pheox.jcapi.JCAPIUtil;

public class PheoxCryptocard {

public static void main(String[] args) throws Exception {

for (String providerName : JCAPIUtil.getCSPs()) {

System.out.println(providerName);
}
}
}

execution :
java -cp bin;lib\jcapi.jar -Djava.library.path=lib\jcapi64.dll com.mnu.cryptocard.PheoxCryptocard


exception :
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.pheox.jcapi.CoreUtilJNI.getCSPs()[Ljava/lang/String;
at com.pheox.jcapi.CoreUtilJNI.getCSPs(Native Method)
at com.pheox.jcapi.s.e(Unknown Source)
at com.pheox.jcapi.JCAPIUtil.getCSPs(Unknown Source)
at com.mnu.cryptocard.PheoxCryptocard.main(PheoxCryptocard.java:9)

project structure:

pheox-cryptocard
|-src
| |-com
| |-mnu
| |-cryptocard
| |-PheoxCryptocard.java
|-bin
| |-com
| |-mnu
| |-cryptocard
| |-PheoxCryptocard.class
|-lib
|-JCAPI.jar
|-JCPAPI32.dll
|-JCPAPI64.dll

java :
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)

system :
Windows 7 Home Premium


Some ideas ?

Author: tommy, Visitor
26/09/2012 22:26:34
Hi,

You must add JCAPI as a security provider to the JCE framework in your program before using it i.e add the following line of code at the beginning of your program:
Security.addProvider(new JCAPIProvider());

For more information, please read the "JCAPI User's Guide" or any of the accompanied example programs.

Sincerely,
Tommy




Register / Login  |  Desktop view  |  Jump to top of page