Java - 如何检测智能卡热插拔

Java  - 如何检测智能卡热插拔

问题描述:

我在java中动态加载pkcs11安全提供程序,只要在运行应用程序之前插入了智能卡读卡器,它就能正常工作。有谁能告诉我如何在应用程序运行时检测智能卡热插拔?其实我在java中需要像pcsc_scan这样的东西。环境是Ubuntu 9.10 with java 1.6.0_20。
提前致谢

I load dynamically pkcs11 security Provider in java and it works as long as the smart card reader is inserted before running the application. Could anyone please tell me how to detect a smartcard hotplug when the application is running? Actually I need something like pcsc_scan in java. The environment is Ubuntu 9.10 with java 1.6.0_20. Thanks in advance

你能否使用 javax.smartcardio。* API与PKCS#11一起使用?

Can you use the javax.smartcardio.* API in conjunction with PKCS #11?

CardTerminal 类有 isCardPresent(), waitForCardPresent(timeout) waitForCardAbsent(timeout)可以在单独的线程中用于轮询卡片插入事件的方法。

The CardTerminal class has isCardPresent(), waitForCardPresent(timeout), and waitForCardAbsent(timeout) methods which can be used in a seperate thread to poll for card insertion events.