Alessandro,
In some cases the implementation of a given APDU command may cause a
card reset or switching from one protocol or communication speed to
another. Such situation may cause this kind of exception. What's the
purpose of 80 02 11 00 00 APDU?
Ciao,
Genaro.
______________________________ Reply Separator _________________________________
Subject: (OCF) sendAPDU with Gemplus GCR410
Author: [EMAIL PROTECTED] (Alessandro Matti) at ISS1
Date: 7/26/100 4:38 PM
I am new to smartcard programming and need a little help.
I have a GCR410 terminal .
My goal is to send various commandAPDU to the card.
My problem comes when I send this APDU command:
CLA: 80
INS: 02
P1: 11
P2: 00
P3: 00
After i send this APDu command i get the following error message:
opencard.core.terminal.CardTerminalException: no response from smartcard
at
com.gemplus.opencard.terminal.GemplusSerialCardTerminal.internalSendAPDU(Gem
plusSerialCardTerminal.java:857)
at
com.gemplus.opencard.terminal.GemCoreCardTerminal.internalSendAPDU(GemCoreCa
rdTerminal.java:349)
at opencard.core.terminal.CardTerminal.sendAPDU(CardTerminal.java:494)
at opencard.core.terminal.SlotChannel.sendAPDU(SlotChannel.java:115)
at it.ssb.intesi.pkcs11PCSC.pkcs11PCSC.Transmit(pkcs11PCSC.java:466)
at
it.ssb.intesi.pkcs11PCSC.pkcs11PCSCa.C_GetTokenInfo(pkcs11PCSCa.java:337)
at it.ssb.intesi.pkcs11PCSC.pkcs11PCSCa.main(pkcs11PCSCa.java, Compiled
Code)
java.lang.NullPointerException:
at
it.ssb.intesi.pkcs11PCSC.pkcs11PCSCa.C_GetTokenInfo(pkcs11PCSCa.java:340)
at it.ssb.intesi.pkcs11PCSC.pkcs11PCSCa.main(pkcs11PCSCa.java, Compiled
Code)
Here is the code for my attempt at writing:
CardId = SlotChan.getCardID(); //ATR
// Select Applet
command.setLength(0);
command.append(selectBuff);
response = SlotChan.sendAPDU(command);
if (response.sw() != 0x9000)
throw new CardServiceException (new String ("Selecting
applet error"));
Rv = SelectGetBuff(FunctionName);
if(Rv != CKR_OK)
return Rv;
command.setLength(0);
command.append(GetBuff);
response = SlotChan.sendAPDU(command);
}// end try
catch(CardTerminalException e){
e.printStackTrace(System.err);
}
The exception occurs on the first SlotChan.sendAPDU(command) call;
The problem is that any apdu command sent before this command have success,
after all apdu command cause the same exception. Why? Is a problem of
Opencard framework?
Thanks
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.