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.

Reply via email to