CardContact / sc-hsm-embedded

PKCS#11 and CSP-Minidriver library for the SmartCard-HSM and STARCOS based signature cards
BSD 3-Clause "New" or "Revised" License
95 stars 31 forks source link

Use static slot id bound to reader name #8

Closed CardContact closed 8 years ago

CardContact commented 9 years ago

Slot ids are allocated sequentially when readers are detected or virtual slots are created. Therefore slot ids may change if the reader detection or card insertion occurs in different sequence.

This issue can be resolved if the slot id is derived from the reader name, e.g. using a CRC32 over the reader name reported by PC/SC. Virtual slots for that reader will get an incremented slot id.

As the slot id may not be unique, this feature must be explicitly enabled by defining the PKCS11_READER_FILTER environment variable (e.g. PKCS11_READER_FILER=*)