Question

How can I search through all available slots in the machine so I can get each keystore for each slot, in Java?

Was it helpful?

Solution

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

OTHER TIPS

Write JNI code in C++ and call it from java.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top