Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Programming multiple smart cards with multiple smart card readers in a PC causes a PCSCException in

user11109299Aug 19 2014 — edited Aug 19 2014

Hi,

I develop a Java code using smartcardio API to program a smart card. My GUI allows to add at most 5 smart card readers that will wait for card present, then do authentication and program the smart card with an application, then wait for card removal. This is a separate thread running in a loop for each smart card reader added as programmer.

The problem occurs when a certain smart card is in progress and I inserted another smart card to another smart card reader.  Both smart card reader halts and throw sun.security.smartcardio.PCSCException: Unknown error 0x8010002f.

I also observed that every time there is an attempt to insert/remove a smart card in the smart card reader that is connected to the USB port would cause the programming in progress to be interrupted and throw the PCSCException.

These are some exceptions I got during my testing:

sun.security.smartcardio.PCSCException: Unknown error 0x8010002f

  at sun.security.smartcardio.PCSC.SCardTransmit(Native Method)

  at sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:171)

java.lang.Exception: Loader Record Failed: 6E | 0 //Sometimes I got this return code SW1 0x6E SW2 0x00 which means an APDU with an invalid 'CLA' bytes was received. I had check the command before it was sent and it was correct.

Help me understand this issue. I think the CardTerminal.isCardPresent(), CardTerminal.waitForCardPresent(0), and CardTerminal.waitForCardAbsent(0) cause this issue that CardChannel.transmit(apduCommand) is interrupted or the smart card insertion/removal causes the CardChannel.transmit(apduCommand) is interrupted.

Regards,

Knivez

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2014
Added on Aug 19 2014
0 comments
1,055 views