EldoS | Feel safer!

Software components for data protection, secure storage and transfer

USB Token insertion/removal detection

Posted: 06/27/2011 09:08:22
by Ken Ivanov (Team)

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:
            // 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 = "...";

            // 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)";

            // closing the storage
            // releasing objects
            storage = null;

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


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...



Topic viewed 4840 times

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


Back to top

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

Got it!