Java - how to detect smartcard hotplug

前端 未结 2 1309
花落未央
花落未央 2021-01-14 17:53

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

相关标签:
2条回答
  • 2021-01-14 18:13

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

    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.

    0 讨论(0)
  • 2021-01-14 18:17

    PKCS#11 doesn't define a standard way to actively notify the application about device insertion/removal. The best you can do is to run a thread which will check the number of slots and their state once a second or so.

    0 讨论(0)
提交回复
热议问题