Your code looks more or less correct (it lacks the TElPKCS11CertStorage.CloseSession() call, yet it is not critical for now), so my initial assumption is obviously wrong. But now I have another one. What action is a trigger for you to call your CloseStorage() method? The reason why I'm asking is that it is not legal to close the storage from the OnSlotEvent event handler; calling CloseStorage() from inside the OnSlotEvent handler may result in a hangup.

No, as I said I am clossing (and opening)session inside my Sign method and for that I am using TElPKCS11SessionInfo methods(Logout and Dispose). I thought it is more or less same, if I do:
storage.CloseSession(0), or
session.Logout()
Am I wrong?

I am not clossing storage from the OnSlotEvent, ofcourse. I call CloseStorage() method on FormClosing event.

Anyway the problem was me :). As I said I made bug where in one case I open storage twice, but close it only once.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.