0

I tried to connect to the luna SA, with the SDK installed and the luna and luna API. I have access to the moon, and I could open session in putty console. I used the login that comes in the example, but sends me an error.

code:

public LunaTokenManager tokenManager = null;
tokenManager = LunaTokenManager.getInstance();
try {
    tokenManager.Login(password);
}
catch (ProviderException e) {
    e.getMessage();
}

to debbug stop in LunaTokenManager.getInstance();

error: Exception in thread "main" com.chrysalisits.crypto.LunaCryptokiException: function 'C_Initialize' returns 0x30 at com.chrysalisits.crypto.LunaCryptokiException.ThrowNew(LunaCryptokiException.java:57) at com.chrysalisits.crypto.LunaAPI.Initialize(Native Method) at com.chrysalisits.crypto.LunaTokenManager.(LunaTokenManager.java:107) at com.chrysalisits.crypto.LunaTokenManager.getInstance(LunaTokenManager.java:62)

the documentation says it is not Java error, but I failed to resolve

http://leifj.nordu.net/luna-docs/007-011136-002_lunasa_5-1_webhelp_rev-a/content/sdk/jsp_errors.htm

Jón Trausti Arason
  • 4,548
  • 1
  • 39
  • 46
bere
  • 1
  • 1
  • 2

1 Answers1

1

C_Initialize mentioned in the exception message is a function from PKCS#11 interface - lower level ANSI C API - which is probably used internally by the Java API.

C_Initialize returned 0x30 which is defined as CKR_DEVICE_ERROR which is described as "Some problem has occurred with the token and/or slot". Maybe you did not setup the connection to Luna SA properly?

I remember some certificates needed to be deployed on the client machine but I can't recall the details.

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
jariq
  • 11,681
  • 3
  • 33
  • 52
  • Thanks @jariq I not find that was the mistake. I have setup the connection when I installed the luna SA in Crystoki and . Also I have client certificates and server. – bere Mar 05 '14 at 18:57
  • 1
    @bere was this issue ever resolved? I see the same issue now – Hollerweger Mar 09 '18 at 12:19