4

I have a problem when I’m trying to access cryptoki.dll from x64 Client. It worked with x86 Client but it is not working with x64.

What should I do to work with cryptoki.dll from x64 Client?

signature.addKeyInfo(new ECertificate(cert.getEncoded()));

var c = HsmManager.getInstance().getSigner("MyPassword", cert);

static Module pkcs11Module = Module.getInstance(@"C:\Program Files\SafeNet\Protect Toolkit 5\Protect Toolkit C SDK\bin\sw\cryptoki.dll");

[MethodImpl(MethodImplOptions.Synchronized)]

public static HsmManager getInstance() {

   pkcs11Module.initialize(null);

   Slot[] slots = pkcs11Module.getSlotList(true);  

}
Abdullah Ilgaz
  • 719
  • 1
  • 17
  • 39
TEngineer
  • 95
  • 1
  • 18
  • 1
    I can not access the device when I use 64 bit dll. "C_Initialize - This object is not connected to a module" – TEngineer Mar 05 '18 at 05:41
  • @MichaelRandall is it possible to use 32 bit dll for 64 bit client? – Abdullah Ilgaz Mar 05 '18 at 06:07
  • 1
    When I use 32 bit dll, I can not enter the slot. I think the reason for this error is because the server has 64 bits and the client has 32 bits. So I get 32 bit, but then I get "CKR_USER_PIN_NOT_INITIALIZED" error. But the cause of the error was found. I will reply in a moment. Thank you for your interest. – TEngineer Mar 06 '18 at 14:50
  • Are you sure you have 64-bit installation (i.e. from folder Win64 of PTK installation media)? It might be useful to check cryptoki.dll dependencies with [Dependency Walker](http://www.dependencywalker.com/). Does KMU for software-only provider work? Which dll does it use (can be checked with [Process Explorer](https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer))? Good luck! – vlp Mar 10 '18 at 16:36
  • yes, now it also works with 64 bit dll, problem solved, thank you – TEngineer Mar 12 '18 at 05:41

0 Answers0