Skip to Main Content

Java Card

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!

PCSC Exception in method SCardTransmit (8010002f)

843851May 11 2005 — edited May 13 2005
Hello,

I have a BIG problem with
PCSC Exception in method SCardTransmit: error occurred with SCardTransmit
return code = 8010002f

Moreover, in my applet, I have a method that generates 4 bytes (I have test it with more) of RandomData in the following way:

...
private RandomData random;
...
...
private void printRandom(APDU apdu) throws ISOException, CryptoException {
byte[] apduBuffer = apdu.getBuffer();
apdu.setIncomingAndReceive();

if (apduBuffer[4] != 0)
throw new ISOException(ISO7816.SW_WRONG_LENGTH);

byte[] randomBuffer = new byte[4];
this.random = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
this.random.generateData(randomBuffer, (short) 0, (short) 4);
apduBuffer[5] = (byte) (randomBuffer[0]);
apduBuffer[6] = (byte) (randomBuffer[1]);
apduBuffer[7] = (byte) (randomBuffer[2]);
apduBuffer[8] = (byte) (randomBuffer[3]);
apdu.setOutgoingAndSend((short) 5, (short) 4);
}
...

I am using Java Card 2.2.1, GemXpresso RAD 3 with Open Card and Eclipse IDE.

When I test this applet on the GemXpresso Simulator, I have no problems, everything is going smoothly, and I receive the expected output. However, when I install the applet on the smart card (GemXpresso 211 PK), and I run the applet from a host application (Eclipse) I receive this error. Strangely enough, it works when I generate 2 bytes, and sometimes works when I generate 4 bytes, but NOT more.
WHY ? Can anybody help? I am trying to understand and solve this problem...

I looked at some OCF forums, and all I could find was:
1) to use the APDU.waitExtension()
2) busy loop
Maybe I do something wrong, because both of these solutions do not work for me.

Any ideas, suggestions, remarks, would be highly appreciated.

Best Regards,
Bojan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2005
Added on May 11 2005
1 comment
1,860 views