cknfast.dll crash problem in IIS

3/14/2015 10:10:26 PM
Total Posts 9

cknfast.dll crash problem in IIS

I am using cknfast.dll x64 version with NCryptoki My desktop test application working perfectly. I run test application multiple at desktop and applications sign with same private key.

I am using same code in web service and hosted in IIS. When I make multiple request I am getting two error in Windows event manager:

Firs error:

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException

Second error:

Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: cknfast-64.dll, version:, time stamp: 0x51f9280d
Exception code: 0xc0000005
Fault offset: 0x0000000000006943
Faulting process id: 0x1228
Faulting application start time: 0x01d05e99f49e5526
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\inetpub\wwwroot\SignatureService\bin\cknfast-64.dll

I try to fix error with ServiceBehavior InstanceContextMode and ConcurrencyMode. I try some combination but not working.

3/15/2015 2:07:16 AM
Total Posts 9

Re: cknfast.dll crash problem in IIS

I can cover something. An application can only once session to HSM over NCryptoki. In IIS there is look like an only one application (request method not important). So I cache tokens with session.

3/16/2015 4:45:02 PM
Total Posts 9

Is it possible to use multiple key in one session?

Is it possible to use multiple key in one session?

We are using SignInit before sign and use private key as parameter. If I have multiple private key, can I use one of them in same session? Is there any complication in multithread application?

3/24/2015 5:02:58 PM
Total Posts 9

Re: cknfast.dll crash problem in IIS

Yes it is possible. But we need some rules:

  • we must make only 1 initialization in same application.
  • we need only one login to token (there is login method on token but I can't call it).
  • open multiple session on token but call login method once on one of them.
  • call singinit before every sign.
  • catch errors and kill session.
4/1/2015 11:34:10 AM
Total Posts 300
Ugo Chirico

Re: cknfast.dll crash problem in IIS

Yes, you can use the same session with different private keys.

Following the PKCS#11 specifications, you should make:

- only one initialization e.g. 1 call to Initialize method

- only one login to the token

- open multiple sessions

- SignInit and all xxxInit methods must be called before the Sign (and xxx) operation


For all that rules, you must follow the PKCS#11 specifications

8/14/2015 1:01:23 PM
Total Posts 1

Re: cknfast.dll crash problem in IIS

Dear <span data-scayt_word="mkysoft" data-scaytid="12">mkysoft,

Would you be able to share your sample desktop app. would be much appreciated!


<span data-scayt_word="Vedat" data-scaytid="5">Vedat at <span data-scayt_word="nommaz" data-scaytid="7">nommaz dot com