EldoS | Feel safer!

Software components for data protection, secure storage and transfer

USB Token insertion/removal detection

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#16841
Posted: 06/27/2011 09:08:22
by Ken Ivanov (EldoS Corp.)

Great, thank you very much for such a comprehensive information about the problem. I think we need to have a deeper look into the issue. Could you please check whether the below piece of code exposes the problem for you:
Code
            // creating the components
            TElPKCS11CertStorage storage = new TElPKCS11CertStorage();
            TElPKCS11CryptoProvider prov = new TElPKCS11CryptoProvider();

            // binding cryptoprovider to the storage component
            storage.CryptoProvider = prov;

            // opening the storage
            storage.DLLName = "...";
            storage.Open();

            // displaying token information
            Log("Available slots: ");
            for (int i = 0; i < storage.Module.SlotCount; i++)
            {
                string s = " - " + storage.Module.get_Slot(i).SlotDescription;
                if (storage.Module.get_Slot(i).TokenPresent)
                {
                    s = s + " (token inserted)";
                }
                Log(s);
            }

            // closing the storage
            storage.Close();
            
            // releasing objects
            storage.Dispose();
            storage = null;

            prov.Dispose();
            prov = null;
            
            // collecting garbage
            GC.Collect();
#16855
Posted: 06/28/2011 03:49:30
by Constantin Danilov (Standard support level)
Joined: 06/25/2011
Posts: 5

Hi,

Good news, your code snippet works great ;)

I've changed my ReleaseStore() method and added storage.Dispose() and prov.Dispose() and that worked perfectly!

Thanks a lot,
Now certainly we'll by the packages...

Reply

Statistics

Topic viewed 4412 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!