List all smartcard slots in Java
How can 开发者_JAVA百科I search through all available slots in the machine so I can get each keystore for each slot, in Java?
As I've found, there is this a way:
PKCS11 p11 = PKCS11.getInstance("/usr/local/lib/libsiecap11.so", "C_GetFunctionList", null, false);
long[] slots = p11.C_GetSlotList(true);
thanks to this question
This is not a very precise question.
If you are not precise, then the "most probable" solution is http://download.oracle.com/javase/6/docs/jre/api/security/smartcardio/spec/javax/smartcardio/CardTerminals.html
But you seem to be talking about PKCS#11 (which is NOT the direct mapping of a smart card hardware "slot")
Write JNI code in C++ and call it from java.
精彩评论