开发者

List all smartcard slots in Java

开发者 https://www.devze.com 2023-04-12 01:01 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消