Java smartcardio APDU response timeout

0

I am using javax.smartcardio to send APDU command to smart card through CardChannel.transmit(CommandAPDU command).

However it seems that there is a timeout somewhere defined as I always get sun.security.smartcardio.PCSCException: Unknown error 0x8010002f when I do not recieve APDU response from smart card.

It is happening when I would like to generate key which takes more than 60 seconds and it always fails after 60 seconds. Every other command for generation of key of less bit length which takes less then 60 seconds works fine.

I was trying to find what is causing this exception but I really don't know. Is it Java specific or should I look somewhere else?

This behaviour is on desktop Windows 7 x64 with Java 8. What is interesting on different desktop with the same OS and Java versions generation works fine without any exceptions...

java
exception
timeout
smartcard
pcsc
asked on Stack Overflow Jul 14, 2016 by user1563721

1 Answer

1

On protocol level (i. e. T=0 or T=1) the card has to send a so-called WTX (waiting time extension) request if it exceeds the time slot as indicated in the BWI of the ATR.

So I would consider these possibilities:

  • The BWI indicated by the card is simply too small. This might be fixed by modifying the ATR (if that is possible)
  • The card has a problem with the timer interrupt service routine responsible for sending out the WTX request
  • The reader does not respond properly to the WTX request, so a different reader may be tried. (Do you have the same reader model with the same firmware version on the other desktop PCs?)

However: none of the possible reasons given is influenced by the operating system or Java version, all are either within the reader or within the card.

answered on Stack Overflow Jul 14, 2016 by guidot

User contributions licensed under CC BY-SA 3.0