0

I'm getting this error when I try to access. How to access HSM in .NET C# with crypto.dll library?

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);   
}
vlp
  • 7,811
  • 2
  • 23
  • 51
TEngineer
  • 95
  • 1
  • 18

1 Answers1

0

I solved my problem.

Solution: HSM device drivers are x86bit. I tried to use x86bit PKCS#11 even client computer is x64. (I tried x64 before)

Then imported x86bit libraries to my project and it works!

TEngineer
  • 95
  • 1
  • 18