Search   Recent Topics     Member Listing   Register /  Login 
JCAPIUtil.getCSPs() fails with java.lang.UnsatisfiedLinkError
Forum Index -> General Issues
Author Message
lolo12
Visitor

Joined: Sep 26, 2012
Messages: 1
Offline

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 ?
tommy
Pheox Support

Joined: May 30, 2005
Messages: 148
Offline

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
 
  Forum Index -> General Issues
Go to: