SELECT APDU

Hello all!
I can't select my applet in the JCWDE.
I have a myapp.app file that contains:
com.sun.javacard.installer.InstallerApplet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0x8:0x1
com.myapplet.javacard.MyClass               0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x6:0x1
the applet AID matches with the AID definition in the opt file that used in convertion.
I run the jcwde and the apdutool to sent the script APDU. The scr file contains:
powerup;
// select MyClass
0x00 0xA4 0x04 0x00 10 0xa0 0x0 0x0 0x0 0x62 0x3 0x1 0xc 0x6 0x1 0xFF;
powerdown;
but the result of the status word (SW1) is 6d :-/ the correct value is 90 (sucessfull)
the result of the apdutool command is:
Java Card 2.2 ApduTool (version 0.20)
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
Opening connection to localhost on port 9025.
Connected.
Received ATR = 0x3b 0xf0 0x11 0x00 0xff 0x00
CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 0a, a0, 00, 00, 00, 62, 03, 01, 0c, 06, 01, Le: 00, SW1: 6d, SW2: 00
Anybody can help me?!
Where is the problem?
rgds,
Igor Medeiros
ICQ 39815017

No :-/
Now, my app file contains:
powerup;
// select the applet installer
0x00 0xA4 0x04 0x00 0x09 0xa0 0x0 0x0 0x0 0x62 0x3 0x1 0x8 0x1 0x7F;
// 90 00 = SW_NO_ERROR
// create a instance of my applet
0x80 0xB8 0x00 0x00 10 0xa0 0x0 0x0 0x0 0x62 0x3 0x1 0xc 0x6 0x1 0x7F;
// select my applet
0x00 0xA4 0x04 0x00 10 0xa0 0x0 0x0 0x0 0x62 0x3 0x1 0xc 0x6 0x1 0x7F;
powerdown;
but the result is
CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 90, SW2: 00
CLA: 80, INS: b8, P1: 00, P2: 00, Lc: 0a, a0, 00, 00, 00, 62, 03, 01, 0c, 06, 01, Le: 00, SW1: 64, SW2: 43
CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 0a, a0, 00, 00, 00, 62, 03, 01, 0c, 06, 01, Le: 00, SW1: 6d, SW2: 00
only the first command return a status word 90 :-/
Can you help me?
Thank you very much,
Igor Medeiros

Similar Messages

  • Problem with select APDU

    Hi all
    I have a problem when trying to test an applet created by me like Sebastian Lorquet proposed in this post:
    Re: Ask Global Platform SecureChannel
    I managed to install my applet on the card, and when I check the applets it contains I can see that the AID of mine appears.
    But when I use it and send APDUs through it, the SELECT command fails me.
    The SELECT APDU instruction is:
    Command -> 00A404000B0102030405060708090000
    where 01 02 03 04 05 06 07 08 09 00 00 is the AID of my applet
    The response is as follows:
    Response <- 6D00 (Invalid instruction byte / Command not supported or invalid)
    Do not understand why I get that answer.
    I am using gpshell, and the command used is:
    select -AID 0102030405060708090000
    Thanks in advance
    Edited by: bra_racing on 05-jul-2012 15:28

    ah ok. Just answer me one thing, are you using below code ?
    package test;
    import javacard.framework.APDU;
    import javacard.framework.Applet;
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import org.globalplatform.GPSystem;
    import org.globalplatform.SecureChannel;
    * @author shane
    public class TestSecureChannel extends Applet {
        private final static byte INS_INIT_UPDATE = 0x50;
        private final static byte INS_EXT_AUTH = (byte) 0x82;
        private TestSecureChannel() {
            // empty
        public static void install(byte bArray[], short bOffset, byte bLength) throws ISOException {
            new TestSecureChannel().register();
        public void process(APDU apdu) throws ISOException {
            if (selectingApplet()) {
                return;
            byte[] buffer = apdu.getBuffer();
            byte cla = buffer[ISO7816.OFFSET_CLA];
            byte ins = buffer[ISO7816.OFFSET_INS];
            SecureChannel sc = GPSystem.getSecureChannel();
            if ((byte) (cla & 0x80) == 0x80) {
                switch (ins) {
                    case INS_INIT_UPDATE:
                    case INS_EXT_AUTH:
                        apdu.setOutgoingAndSend(ISO7816.OFFSET_CDATA, sc.processSecurity(apdu));
                        return;
                    default:
                        // fall through
            switch (ins) {
                case (byte) 0x01:
                    buffer[0] = sc.getSecurityLevel();
                    apdu.setOutgoingAndSend((short) 0, (short) 1);
                    break;
                default:
                    ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    }If not above one then copy past your code here. For time being for what I understand it that to send get data command your currently selected application should be card manager.
    Edited by: Umer on Jul 10, 2012 4:34 PM

  • Detect SELECT APDU

    Hi everyone
    I'm writing an applet (Java Card 2.1.1) and in the process method I'm trying to detect the SELECT APDU command, but it's not working. I send a SELECT APDU to my applet, it throws a SW_CLA_NOT_SUPPORTED exception, and it is selected. Ok, the command ends up doing what it is supposed to do, but my applet throws an exception, and it shouldn't.
    Here's my code:
    public void process(APDU apdu) throws ISOException {
      byte[] buffer = apdu.getBuffer();
      byte cla  = buffer[ISO7816.OFFSET_CLA];
      byte ins = buffer[ISO7816.OFFSET_INS];
      if (cla == CLA_FUNCIONARIO) {
          try {
              switch (ins) {
                  // all my cases
                  default:
                      ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
          catch (UserException e) {
              ISOException.throwIt(e.getReason());
      else if (selectingApplet()) {
          return;
      else {
          byte tamanho_lido = (byte) apdu.setIncomingAndReceive();
          apdu.setOutgoing();
          apdu.setOutgoingLength((short) (tamanho_lido + 4));
          apdu.sendBytes((short) 0, (short) 4);
          apdu.sendBytes(ISO7816.OFFSET_CDATA, tamanho_lido);
          ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    }First of all, I don't know what exactly does the method selectingApplet - in several source codes I've seen around, the verification for the SELECT APDU is done like this:
    (cla == ISO7816.CLA_ISO7816 && ins == ISO7816.INS_SELECT)But, there are some sample codes (like the JavaPurse on JCDK 2.1.1) that prove these two ways of checking the SELECT APDU is not equivalent. So, what's the difference between using the selectingApplet method and using the constants on the ISO7816 interface? Should I use both ways? Only one of them???
    The big problem is what is actually happening to my card. As it can be seen in the code above, if the applet is about to throw an SW_CLA_NOT_SUPPORTED exception, it writes the whole command that it received, so I can see what got there (sort of a System.out.println debugging). And here's what happens: everytime I send the command 0x00 0xA4 0x04 0x00 0x06 0x01 0x02 0x03 0x04 0x05 0x06 0x00, it returns 0x00 0xC0 0x00 0x00 as the response data and 0x6E00 as the status word!!! I googled and I found that C0 is the INS byte of the GET RESPONSE command. What is this command? It's not documented on the GlobalPlatform 2.0.1' specification. And why the hell my applet says it received this command when I send it a SELECT APDU?
    Any answer would be valuable :)
    Thanks!

    You are in the ISO7816 T=0 protocol. The 00CO000000 command is issued to receive the response to the previous SELECT command. You are not returning any data to the SELECT command, but the terminal side seems to insist on getting one.
    The GetResponse command should not be passed to the Applet by your card operating system, I consider this a bug.
    If you return data when selectingApplet() returns true, then you probably will not have any problem.

  • Send select apdu with jcoop

    Hi, finally i have been able to install the applet in my nokia 6131 NFC!
    now i want to send a select apdu command.
    the card-info says that my applet is loaded.
    Card Manager AID   :  A000000003000000
    Card Manager state :  SECURED
        Application:  SELECTABLE (---L----) D276000005AB0503E0040101
        Application:  SELECTABLE (--------) D276000005AA0503E0050101
        Application:  SELECTABLE (--------) A00000006203010C01
        Load File  :      LOADED (--------) A0000000035350   (Security Domain)
        Load File  :      LOADED (--------) D276000005AA040360010410
        Load File  :      LOADED (--------) D276000005AA0503E00401
        Load File  :      LOADED (--------) D276000005AA0503E00501
        *Load File  :      LOADED (--------) 0A0000006203010C0101*I have tried the following commands:
    May be the state of the applet would be "SELECTABLE"? How can i change this state?
    cm>  /select 0A0000006203010C0101
    => 00 A4 04 00 0A 0A 00 00 00 62 03 01 0C 01 01 00    .........b......
    (11395 usec)
    <= 6A 82                                              j.
    Status: File not found
    jcshell: Error code: 6a82 (File not found)
    jcshell: Wrong response APDU: 6A82
    cm>  send 00a404000a0A0000006203010C0101
    => 00 A4 04 00 0A 0A 00 00 00 62 03 01 0C 01 01       .........b.....
    (11300 usec)
    <= 6A 82                                              j.
    Status: File not found

    You have a typo in your SELECT command. According to GET STATUS the AID of the targeted application is
    AID: A0 00 00 00 62 03 01 0C 01
    and you're sending in the select command
    CLA, INS, P1, P2, Lc: 00 A4 04 00 0A
    AID 0A 00 00 00 62 03 01 0C 01 01
    See the difference? Furthermore you cannot select packages, only applications which are in the SELECTABLE application life cycle.

  • SELECT APDU disables STK events?

    Hi,
    How come after I select an applet with the SELECT APDU command, STK events no longer trigger the processToolkit method?
    STK events work fine prior to the APDU command. After an applet has been selected, not even the menu event works.
    Thanks all!

    Although you would have had your answers by now .... but if incase .... :)
    There is a difference between ToolkitApplets and normal Applets. When working with Toolkit Applet, the method processToolkit() is actually provoked by "GSM Applet" which is actually the selected Applet at the moment.
    Thanks,
    AQ

  • SELECT APDU? How do I interprete this SW1 and SW2? HELP!

    Hi,
    Earlier today I had problems regarding communicating with my GemPlus PC430. I used OpenCard Framework. I've now discovered that Java 6 has support for smartcards through javax.smartcardio.*. I can now communicate with the cardreader/card, but when I do so I get the output shown be. How should I interpret the values of Select Resp and response.
    Terminals: [PC/SC terminal Gemplus GemPC430 0]
    card: PC/SC card in Gemplus GemPC430 0, protocol T=0, state OK
    Select Resp:  6A 82
    response:  6D 00
    I use the following APDU's:
    static byte[] selectUserApplet = new byte[] {(byte)0x00, (byte)0xA4, (byte)0x04, (byte)0x00, (byte)0x09, (byte)0xa0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x62, (byte)0x3, (byte)0x1, (byte)0xc, (byte)0x5};
    static byte[] getID = {(byte)0x80, (byte)0x02, (byte)0x00, (byte)0x00};
    The AID is: 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x5
    The CLA is: 0x80
    The INS is: 0x02
    So - what is the 6A 82 and the 6D 00?
    Thank you in advance...
    Kind Regards
    /Haber
    Edited by: Haber on Sep 20, 2007 9:41 AM

    When I load the Applet this is the out put is the applet loaded or?????????????
    Java Card 2.2.2 APDU Tool, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to lic
    ense terms.
    WARNING: PC/SC is not officially supported and may not work on all platforms.
    Before SCardEstablishContext ...
    After SCardEstablishContext ...
    SUCCESS ...-855572480
    Reader 0 : Gemplus GemPC430 0NativeConnect Context is ... -855572480
    NativeConnect card is ... ea010000
    NativeStatus card is ... ea010000
    Received ATR = 0x3f 0x6d 0x00 0x00 0x80 0x31 0x80 0x65 0xb0 0x05 0x01 0x02 0x5e 0x83 0x00 0x90 0x00
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 14
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 6a, SW2: 82
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b0, P1: 00, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 01, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 27
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 01, P2: 00, Lc: 16, 01, 00, 13, de, ca, ff, ed, 01, 02, 04, 00, 01, 09, a0, 00, 00, 00, 62, 03, 01, 0c, 05, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 01, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 02, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 02, P2: 00, Lc: 20, 02, 00, 1f, 00, 13, 00, 1f, 00, 0e, 00, 15, 00, 7e, 00, 1e, 02, 18, 00, 12, 00, 4d, 00, 00, 01, 3d, 00, 03, 00, 01, 00, 04, 02, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 7
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 02, P2: 00, Lc: 02, 01, 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 02, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 04, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 29
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 04, P2: 00, Lc: 18, 04, 00, 15, 02, 03, 01, 07, a0, 00, 00, 00, 62, 01, 01, 00, 01, 07, a0, 00, 00, 00, 62, 00, 01, Le: 00, SW1: 69, SW2:85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 04, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 03, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 22
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 03, P2: 00, Lc: 11, 03, 00, 0e, 01, 0a, a0, 00, 00, 00, 62, 03, 01, 0c, 05, 01, 00, 0c, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 03, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 06, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 06, P2: 00, Lc: 20, 06, 00, 1e, 00, 80, 03, 00, ff, 00, 07, 01, 00, 00, 00, 18, 00, 80, 03, 02, 00, 01, 04, 04, 00, 00, 00, b0, ff, ff, 00, a3, 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 6
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 06, P2: 00, Lc: 01, b8, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 06, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 07, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 07, 02, 18, 00, 01, 40, 18, 8c, 00, 10, 18, 8b, 00, 1d, 7a, 04, 30, 8f, 00, 02, 18, 1d, 1e, 8c, 00, 03, 7a, 02, 21, 19, 8b, 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 04, 2d, 1a, 04, 25, 73, 00, 17, 00, 02, 00, 03, 00, 0b, 00, 11, 18, 19, 8c, 00, 05, 7a, 18, 19, 8c, 00, 06, 7a, 7a, 04, 22, 19, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 8b, 00, 04, 2d, 19, 8b, 00, 07, 32, 19, 7b, 00, 08, 92, 8b, 00, 09, 19, 7b, 00, 08, 03, 7b, 00, 08, 92, 8b, 00, 0a, 7a, 03, 22, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 19, 8b, 00, 04, 2d, 19, 8b, 00, 07, 32, 1a, 03, 7c, 00, 0b, 8d, 00, 0c, 3b, 19, 03, 04, 8b, 00, 0d, 7a, 05, 40, 18, 8c, 00, 10, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 18, 8f, 00, 0e, 3d, 06, 10, 08, 8c, 00, 0f, 87, 00, ad, 00, 19, 1e, 1f, 8b, 00, 11, 18, 8b, 00, 1d, 7a, 04, 30, 8f, 00, 12, 18, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 1d, 1e, 8c, 00, 13, 7a, 01, 10, ad, 00, 8b, 00, 14, 61, 04, 03, 78, 04, 78, 01, 10, ad, 00, 8b, 00, 15, 7a, 02, 21, 19, 8b, 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 04, 2d, 1a, 03, 25, 61, 0a, 1a, 04, 25, 10, a4, 6b, 03, 7a, 1a, 03, 25, 10, b0, 6a, 08, 11, 6e, 00, 8d, 00, 16, 1a, 04, 25, 75, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 00, 2d, 00, 04, 00, 20, 00, 27, 00, 30, 00, 21, 00, 40, 00, 1b, 00, 50, 00, 15, 18, 19, 8c, 00, 17, 7a, 18, 19, 8c, 00, 18, 7a, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 18, 19, 8c, 00, 19, 7a, 18, 19, 8c, 00, 1a, 7a, 11, 6d, 00, 8d, 00, 16, 7a, 03, 24, ad, 00, 8b, 00, 1b, 61, 08, 11, 63, 01, 8d, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 00, 16, 19, 8b, 00, 04, 2d, 1a, 07, 25, 32, 19, 8b, 00, 1c, 5b, 29, 04, 1f, 04, 6b, 07, 16, 04, 04, 6a, 08, 11, 67, 00, 8d, 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 16, 1a, 08, 25, 29, 05, 16, 05, 10, 7f, 6e, 06, 16, 05, 63, 08, 11, 6a, 83, 8d, 00, 16, af, 01, 16, 05, 41, 11, 7f, ff
    , 6f, 08, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 11, 6a, 84, 8d, 00, 16, 18, af, 01, 16
    , 05, 41, 89, 01, 7a, 03, 24, ad, 00, 8b, 00, 1b, 61, 08, 11, 63, 01, 8d, 00, 16
    , 19, 8b, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 00, 04, 2d, 1a, 07, 25, 32, 19, 8b, 00
    , 1c, 5b, 29, 04, 1f, 04, 6b, 07, 16, 04, 04, 6a, 08, 11, 67, 00, 8d, 00, 16, 1a
    , 08, 25, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 29, 05, 16, 05, 10, 7f, 6e, 06, 16, 05
    , 63, 08, 11, 6a, 83, 8d, 00, 16, af, 01, 16, 05, 43, 63, 08, 11, 6a, 85, 8d, 00
    , 16, 18, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, af, 01, 16, 05, 43, 89, 01, 7a, 04, 22
    , 19, 8b, 00, 04, 2d, 19, 8b, 00, 07, 32, 1f, 05, 6d, 08, 11, 67, 00, 8d, 00, 16
    , 19, 05, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 8b, 00, 09, 1a, 03, af, 01, 10, 08, 4f
    , 5b, 38, 1a, 04, af, 01, 11, 00, ff, 53, 5b, 38, 19, 03, 05, 8b, 00, 0d, 7a, 04
    , 22, 19, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 32
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 1b, 8b, 00, 04, 2d, 19, 8b, 00, 1c, 5b, 32
    , ad, 00, 1a, 08, 1f, 8b, 00, 1e, 61, 08, 11, 63, 00, 8d, 00, 16, 7a, Le: 00, SW
    1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 07, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 08, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 26
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 08, P2: 00, Lc: 15, 08, 00, 12, 00, 03, 00, 01, 00, 01, 03
    , 00, 04, 4d, 61, 64, 73, 00, 00, 00, 01, 01, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 08, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 05, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 20, 05, 00, 7e, 00, 1f, 02, 00, 0c, 00, 02
    , 00, 0c, 01, 01, 00, 00, 00, 06, 00, 00, 01, 03, 80, 0a, 01, 06, 00, 00, 3a, 06
    , 00, 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 20, 5b, 03, 80, 0a, 07, 05, 00, 00, 00, 03
    , 80, 0a, 09, 03, 80, 0a, 05, 05, 00, 00, 02, 06, 80, 10, 06, 03, 80, 0a, 04, 01
    , 80, 09, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 20, 00, 06, 80, 09, 00, 06, 80, 03, 00, 03
    , 80, 09, 08, 01, 00, 0c, 00, 06, 00, 00, 77, 03, 80, 09, 02, 03, 80, 09, 05, 06
    , 80, 07, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 20, 01, 06, 00, 01, c5, 06, 00, 01, 6c, 06
    , 00, 01, 10, 06, 00, 01, fa, 03, 80, 09, 04, 03, 80, 0a, 06, 03, 80, 03, 01, 03
    , 80, 09, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 6
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 01, 01, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 05, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b2, P1: 09, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 09, P2: 00, Lc: 20, 09, 00, 4d, 00, 0f, 89, 02, 1b, 0d, 60
    , 41, 11, 05, 05, 41, 0e, 05, 20, 09, 1c, 00, 3a, 05, 04, 06, 06, 07, 14, 06, 08
    , 05, 05, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 37
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 09, P2: 00, Lc: 20, 04, 04, 04, 04, 07, 05, 06, 03, 07, 07
    , 04, 07, 0a, 04, 06, 06, 08, 0d, 07, 1b, 1d, 06, 06, 06, 07, 08, 08, 04, 09, 12
    , 15, 10, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 21
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b4, P1: 09, P2: 00, Lc: 10, 10, 08, 04, 09, 12, 15, 0d, 0f, 05, 0b
    , 05, 19, 07, 05, 0a, 08, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: bc, P1: 09, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 5
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: ba, P1: 00, P2: 00, Lc: 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 17
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 80, INS: b8, P1: 00, P2: 00, Lc: 0c, 0a, a0, 00, 00, 00, 62, 03, 01, 0c, 05
    , 01, 00, Le: 00, SW1: 69, SW2: 85
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 15
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 0a, a0, 00, 00, 00, 62, 03, 01, 0c, 05, 01
    , Le: 00, SW1: 6a, SW2: 82
    NativeDisconnect is ... ea010000

  • Is it possible send a SELECT APDU from one applet to another?

    Hello i want to select one applet from another. is it possible and how?. Thanks

    OK, I went to use this today, and can't figure it out.  Where do I place this code; In the SQL of a query, In the VBA of a form, or In a Modual?
    UPDATE Registrations RIGHT JOIN Registrations2
    ON Registrations.TEXT_REGISTRANT_ID = Registrations2.TEXT_REGISTRANT_ID
    SET Registrations.TEXT_REGISTRANT_ID = Registrations2.TEXT_REGISTRANT_ID,
    Registrations.[Name] = Registrations2.[Name]

  • 6985  and 6881 for any subsequent APDU. Where is the source of the problem?

    Hi.
    I'm trying to load applet to Athena Card (Java Card compliant) with JCOP Tools. Although the load process finishes successfully, subsequent install [for install and for make selectable] APDU is responded with 6985 error code - �Condition of use not satisfied� (according to Global Platform specification 2.2.1). After that any APDU sent to the card is responded with 6881 error code - �Logical channel not supported� (according to ISO/IEC 7816-4 document).
    I'm sure that these errors are not sent from our applet. First of all I double checked the install routine of the applet and it does not send such error. Second, I don't use any logical channel, only the main one.
    What may be the source of this behavior?
    Thank you in advance,
    Best regards, neutrino.

    I have JCOP41 v 2.3.1 and it has RetailMAC.
    I'm implementing now this algorithm and it's too complicated. Could you give me suggestions on how to implement it?
    I have already wrote these lines (not completed yet, but I'm sure you will understand what I'm trying to do). Please forgive me for ugly code. I'm a C# developer and I do not have enough Java experience in my background.
        // Here goes section of Retail MAC signing/verification
        // Coded by Gregory Stein.
        private static final byte BAC_MAC_VERIFY = 1;
        private static final byte BAC_MAC_SIGN = 2;
        private static final byte BAC_KS_MAC_VERIFY = 3;
        private static final byte BAC_KS_MAC_SIGN = 4;
        private byte[][] lastMAC = new byte[2][8];
        private byte[] mac = new byte[8];
         * @author Gregory Stein
         * Generates the signature of all/last input data
         * using Retail MAC algorithm as defined in Global
         * Platform specification Appendix B.1.2.2 and as described in
         * ISO 9797-1: MAC Algorithm 3 with output
         * transformation 3, without truncation, and with DES taking
         * the place of the block cipher.
          * @param input input buffer containing data to be sign
          * @param inputOffset the offset into the input buffer at which to begin signature generation
          * @param inputLength the byte length to sign
          * @param signatureBuffer the output buffer to store signature data
          * @param signatureOffset the offset into sigBuff at which to begin signature data
          * @return number of bytes of signature output in sigBuff
         private short sign(byte[] input, short inputOffset, short inputLength,
                   byte[] signatureBuffer, short signatureOffset, byte instance)
              short signBytes = 0;
              Cipher cipherDES = Cipher.getInstance(Cipher.ALG_DES_CBC_ISO9797_M2, false);
              DESKey keyDES;
              byte[] iv;
              if (instance > 2) {
                   iv = lastMAC[1];
                   keyDES = bacKSmacKey3;
              } else {
                   iv = lastMAC[0];
                   keyDES = bacKmacKey3;
              cipherDES.init(keyDES, Cipher.MODE_ENCRYPT, iv, (short)0, (short)8);
              cipherDES.doFinal(input, inputOffset, inputLength, mac, (short)0);
              cipherDES = Cipher.getInstance(Cipher.ALG_DES_ECB_NOPAD, false);
              cipherDES.init(keyDES, Cipher.MODE_DECRYPT, mac, (short)0, (short)8);
              cipherDES.doFinal(inBuff, inOffset, inLength, outBuff, outOffset)
              // Here I'm writing now
              switch(instance)  {
                   case BAC_MAC_VERIFY:
                   case BAC_MAC_SIGN:
                   case BAC_KS_MAC_VERIFY:
                   case BAC_KS_MAC_SIGN:
              return signBytes;
         // End of signing/verification sectionPlease advise me, how can I reduce this code? Or improve it in some way?
    Thank you in advance.
    Best regards, neutrino.

  • Urgent ! writing a java card applet -APDU problem

    hi
    i'm fairly new to the java programming language. i'm trying to write an RSA java card applet to run on a java card simulator.
    I am not sure at all what code i need to write for the CLA byte in the command APDU and what code i need to write for the INS byte in the command APDU, and where exactly to put it in my program.
    if anybody knows please could you help me out.
    So far i have written the code below.
    thanx
    louise
    import javacard.framework.*;
    import java.math.*;
    import java.util.*;
    /*the public key is the public part of the key. Anyone
    can have it. It can only encrypt data, not decrypt.*/
    public class publickey extends Applet{
    //code of the CLA byte in the command APDU header
    final static byte publickey_CLA = (byte)0x00;
    //max number of characters for text message is 60
    final static char MAX_TXT_MSG = 0x3c;
    //MAX number of tries (3) before PIN is blocked
    final static byte PIN_TRY_LIMIT = (byte)0x03;
    //size of PIN must be 4 digits long
    final static byte PIN_SIZE = (byte)0x04;
    //below status word(SW) values are returned by applet
    //in certain circumstances:
    //signal that the PIN verification failed
    final static short SW_PIN_VERIFICATION_FAIL = 0x6300;
    //signal that PIN validation required for txt msging
    final static short SW_PIN_VERIFICATION_REQUIRED = 0x630;
    //instance variables declaration
    OwnerPIN pin; //variable for holding owners pin
    BigInteger n,e;
    String owner;//variable for holding owners name
    /*make a public key. Do not do it yourself, but
    make a public key from a private key.*/
    publickey(String iowner,BigInteger in,BigInteger ie){
    owner=iowner;
    n=in;
    e=ie;
    public void process (APDU apdu) {
    byte[] buffer = apdu.getBuffer();
    //check Select APDU command
    if((buffer[ISO7816.OFFSET_CLA] ==0) &&
    (buffer[ISO7816.OFFSET_INS] ==(byte) (0xA4)) )
    return;
    if(buffer[ISO7816.OFFSET_CLA] !=publickey_CLA)
    ISOException.throwIt
    (ISO7816.SW_CLA_NOT_SUPPORTED);
    /*read the key back from a string.*/
    publickey(String from){
    StringTokenizer st=new StringTokenizer(from," ");
    owner=st.nextToken();
    n=readBI(st.nextToken());
    e=readBI(st.nextToken());
    /*use the key to encrypt a 'message' m. m should be a
    number from 1 to n (n not included).
    use makemessage to convert your message to a BigInteger.
    BigInteger encrypt(BigInteger m){
    return m.modPow(e,n);
    /*make a string from this key.*/
    public String toString(){
    return owner+" "+printBI(n)+" "+printBI(e);
    /*help methods for reading and writing:*/
    final static int radix=36;
    static String printBI(BigInteger b){
    return b.toString(radix);
    static BigInteger readBI(String s){
    return new BigInteger(s,radix);
    /* these methods convert an arbitrary message,
    in the form of an array of bytes, to a message
    suitable for encryption. To do this random bits
    are added (this is needed to make cracking of the
    system harder), and it is converted to a BigInteger.*/
    BigInteger makemessage(byte[] input){
    /*to understand this part of the program,
    read the description of the BigInteger constructor
    (in the standard java help). */
    if(input.length>128 ||
    input.length*8+24>=n.bitLength())
    return new BigInteger("0"); //error! message to long.
    byte[] paddedinput=new byte[n.bitLength()/8-1];
    for(int i=0;i<input.length;i++)
    paddedinput[i+1]=input;
    paddedinput[0]=(byte)input.length;
    for(int i=input.length+1;i<paddedinput.length;i++)
    paddedinput[i]=(byte)(Math.random()*256);
    return new BigInteger(paddedinput);
    /*the inverse of makemessage.*/
    static byte[] getmessage(BigInteger b){
    byte[] paddedoutput=b.toByteArray();
    byte[] output=new byte[paddedoutput[0]];
    for(int i=0;i<output.length;i++)
    output[i]=paddedoutput[i+1];
    return output;
    class privatekey{
    /*the data of a key*/
    BigInteger n,e,d;
    String owner;
    int bits;
    Random ran;
    /*unimportant things, needed for calculations:*/
    static int certainty=32;
    static BigInteger one=new BigInteger("1"),
    three=new BigInteger("3"),
    seventeen=new BigInteger("17"),
    k65=new BigInteger("65537");
    /*make a new key. supply the name of the owner of the
    key, and the number of bits.
    owner: all spaces will be replaced with underscores.
    bits: the more bits the better the security. Every
    value above 500 is 'safe'. If you are a really paranoid
    person, you should use 2000.*/
    privatekey(String iowner,int ibits){
    BigInteger p,q;
    bits=ibits;
    owner=iowner.replace(' ','_');//remove spaces from owner name.
    ran=new Random();
    p=new BigInteger(bits/2,certainty,ran);
    q=new BigInteger((bits+1)/2,certainty,ran);
    n=p.multiply(q);
    BigInteger fi_n=fi(p,q);
    e=chooseprimeto(fi_n);
    d=e.modInverse(fi_n);
    /*read the key back from a string*/
    privatekey(String from){
    StringTokenizer st=new StringTokenizer(from," ");
    st.nextToken();
    n=readBI(st.nextToken());
    e=readBI(st.nextToken());
    d=readBI(st.nextToken());
    /*some help methods:*/
    static BigInteger fi(BigInteger prime1,BigInteger prime2){
    return prime1.subtract(one).multiply(prime2.subtract(one));
    static BigInteger BI(String s)
    {return new BigInteger(s);}
    BigInteger chooseprimeto(BigInteger f){
    /*returns a number relatively prime to f.
    this number is not chosen at random, it first
    tries a few primes with few 1's in it. This
    doesn't matter for security, but speeds up computations.*/
    if(f.gcd(three).equals(one))
    return three;
    if(f.gcd(seventeen).equals(one))
    return seventeen;
    if(f.gcd(k65).equals(one))
    return k65;
    BigInteger num;
    do{
    num=new BigInteger(16,ran);
    }while(!f.gcd(num).equals(one));
    return num;
    final static int radix=36;
    static String printBI(BigInteger b){
    return b.toString(radix);
    static BigInteger readBI(String s){
    return new BigInteger(s,radix);
    /*returns the public key of this private key.*/
    publickey getpublickey(){
    return new publickey(owner,n,e);
    /*the same encryption that the public key does.*/
    BigInteger encrypt(BigInteger m){
    return m.modPow(e,n);
    /*decryption is the opposite of encryption: it
    brings the original message back.*/
    BigInteger decrypt(BigInteger m){
    return m.modPow(d,n);
    public String toString(){
    return owner+" "+printBI(n)+" "+printBI(e)+" "+printBI(d);
    /*this main demonstrates the use of this program.*/
    public static void main(String[] ps){
    say("************ make key:");
    privatekey priv=new privatekey("sieuwert",92);
    publickey pub=priv.getpublickey();
    say("the public key:"+priv);
    say("************ encrypt message:");
    byte[] P="RUOK?".getBytes();
    BigInteger Pc=pub.makemessage(P);
    say("converted:\t"+printBI(Pc));
    BigInteger C=pub.encrypt(Pc);
    say("coded message: "+printBI(C));
    say("************ decrypt message:");
    BigInteger Pc2=priv.decrypt(C);
    say("decoded:\t"+printBI(Pc2));
    byte[] P2=publickey.getmessage(Pc2);
    say("deconverted: "+new String(P2));
    static void say(String s){
    System.out.println(s);

    Command APDU is not written in your source code, rather it is sent from PC or programmed Card Acceptance Device/ Card Reader/ Terminal.
    The code installed in the Java Card should be able to handle the Command APDU received and process it accordingly, and finally your code should be able to send out response APDU.
    You may think your code as a decoder, to retrieve each byte (CLA, INS, P1, P2, DATA, LC) using the Java Card API, you should be able to do it.
    Also, I notice in your code that you want to work out with strings, but Java Card does not support strings, chars, long, float, double ...
    to send out reponse APDU, there are certain steps that you can use, not just simply print like ordinary J2SE may use.
    hope this will help u

  • APDU processing

    Hello,
    While i was mining for informations i meet some contradicitons. I don't really understand how does JCRE deal with the applet selecting apdu-s? It's processed automatically, or JCRE passes this apdu also to the active applet's process method, and then the applet must redistribute it back to the JCRE. In other words, should i check for SELECT APDU-s in my process() method?
    Thanks for your comments in advance,
    Dave

    See A applet Remains in the suspended State until it is explicitly selected .The Applet Selection occurs when the JCRE recives a SELECT APDU whose data matches with the AID of the Applet .The JCRE informs of the applet of it's selection by invoking select method.
    The applet returns true from the call to select method if it is ready to accept the APDU commant via it's process method or it can decline by setting false.
    so here the main work is done by JCRE .
    Neelesh .
    If you still are not getting it .
    mail me at [email protected]

  • Installer Applet Selection Problem

    Dear All,
    I am having a little problem in installation of applet on the actual java card.
    I have giesecke & Devrient 3.0 Contactless Java Card.
    I was having problem in installing my applet. So i have removed all the apdus from the script and left only applet selection apdu as below:
    Script:
    powerup;
    0x00 0xA4 0x04 0x00 0x09 0xa0 0x00 0x00 0x00 0x62 0x03 0x01 0x08 0x01 0x7F;
    powerdown;
    The result when i try to send this to the card using apdutool:
    C:\Documents and Settings\santosh\Desktop>apdutool -pcsc wallet.scr
    Java Card 2.2.2 APDU Tool, Version 1.3
    Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    WARNING: PC/SC is not officially supported and may not work on all platforms.
    Before SCardEstablishContext ...
    After SCardEstablishContext ...
    SUCCESS ...-855572480
    Reader 0 : SCM Microsystems Inc. SDI010 Contactless Reader 0
    Reader 1 : SCM Microsystems Inc. SDI010 Smart Card Reader 0
    Using reader SCM Microsystems Inc. SDI010 Contactless Reader 0
    NativeConnect Context is ... -855572480
    NativeConnect card is ... ea010000
    NativeStatus card is ... ea010000
    Received ATR = 0x3b 0xfe 0x91 0x00 0xff 0x91 0x81 0x71 0xfe 0x40 0x00 0x41 0x28 0x00 0x41 0x33 0xb1 0x00 0x73 0xc8 0x40 0x13 0x0
    0 0x90 0x00 0x9d
    NativeTransmit card is ... ea010000
    NativeTransmit_barray(): inlen 14
    NativeTransmit_barray(): return code 0x0, return length 2
    CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 6a, SW2: 82
    NativeDisconnect is ... ea010000
    What could be going wrong, will the installer applet id be different for different cards.
    I know there has seen a similar post on this forum but the problem as prescribed in the replies to that post i cannot use JCOP tools right now as i am unable to find any download related to JCOPS.
    Any help will be appreciated.
    Regards
    Santosh

    Script:
    powerup;
    // Select the installer applet
    0x00 0xA4 0x04 0x00 0x08 0xA0 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x7F;
    0x80 0xB0 0x00 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Header.cap
    0x80 0xB2 0x01 0x00 0x00 0x7F;
    0x80 0xB4 0x01 0x00 0x16 0x01 0x00 0x13 0xDE 0xCA 0xFF 0xED 0x01 0x02 0x04 0x00 0x01 0x09 0xA0 0x00 0x00 0x00 0x62 0x03 0x01 0x0C 0x01 0x7F;
    0x80 0xBC 0x01 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Directory.cap
    0x80 0xB2 0x02 0x00 0x00 0x7F;
    0x80 0xB4 0x02 0x00 0x20 0x02 0x00 0x1F 0x00 0x13 0x00 0x1F 0x00 0x0E 0x00 0x0B 0x00 0x36 0x00 0x0C 0x00 0x67 0x00 0x0A 0x00 0x13 0x00 0x00 0x00 0x6C 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x7F;
    0x80 0xB4 0x02 0x00 0x02 0x01 0x00 0x7F;
    0x80 0xBC 0x02 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Import.cap
    0x80 0xB2 0x04 0x00 0x00 0x7F;
    0x80 0xB4 0x04 0x00 0x0E 0x04 0x00 0x0B 0x01 0x02 0x01 0x07 0xA0 0x00 0x00 0x00 0x62 0x01 0x01 0x7F;
    0x80 0xBC 0x04 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Applet.cap
    0x80 0xB2 0x03 0x00 0x00 0x7F;
    0x80 0xB4 0x03 0x00 0x11 0x03 0x00 0x0E 0x01 0x0A 0xA0 0x00 0x00 0x00 0x62 0x03 0x01 0x0C 0x01 0x01 0x00 0x14 0x7F;
    0x80 0xBC 0x03 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Class.cap
    0x80 0xB2 0x06 0x00 0x00 0x7F;
    0x80 0xB4 0x06 0x00 0x0F 0x06 0x00 0x0C 0x00 0x80 0x03 0x01 0x00 0x01 0x07 0x01 0x00 0x00 0x00 0x1F 0x7F;
    0x80 0xBC 0x06 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/Method.cap
    0x80 0xB2 0x07 0x00 0x00 0x7F;
    0x80 0xB4 0x07 0x00 0x20 0x07 0x00 0x67 0x00 0x02 0x10 0x18 0x8C 0x00 0x01 0x18 0x11 0x01 0x00 0x90 0x0B 0x87 0x00 0x18 0x8B 0x00 0x02 0x7A 0x02 0x30 0x8F 0x00 0x03 0x3D 0x8C 0x00 0x04 0x7F;
    0x80 0xB4 0x07 0x00 0x20 0x3B 0x7A 0x05 0x23 0x19 0x8B 0x00 0x05 0x2D 0x19 0x8B 0x00 0x06 0x32 0x03 0x29 0x04 0x1F 0x65 0x1B 0x1A 0x08 0xAD 0x00 0x16 0x04 0x1F 0x8D 0x00 0x07 0x3B 0x16 0x7F;
    0x80 0xB4 0x07 0x00 0x20 0x04 0x1F 0x41 0x29 0x04 0x19 0x08 0x8B 0x00 0x08 0x32 0x70 0xE6 0x19 0x8B 0x00 0x09 0x3B 0x19 0x16 0x04 0x08 0x41 0x8B 0x00 0x0A 0x19 0x03 0x08 0x8B 0x00 0x0B 0x7F;
    0x80 0xB4 0x07 0x00 0x0A 0x19 0xAD 0x00 0x03 0x16 0x04 0x8B 0x00 0x0C 0x7A 0x7F;
    0x80 0xBC 0x07 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/StaticField.cap
    0x80 0xB2 0x08 0x00 0x00 0x7F;
    0x80 0xB4 0x08 0x00 0x0D 0x08 0x00 0x0A 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x7F;
    0x80 0xBC 0x08 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/ConstantPool.cap
    0x80 0xB2 0x05 0x00 0x00 0x7F;
    0x80 0xB4 0x05 0x00 0x20 0x05 0x00 0x36 0x00 0x0D 0x02 0x00 0x00 0x00 0x06 0x80 0x03 0x00 0x03 0x80 0x03 0x01 0x01 0x00 0x00 0x00 0x06 0x00 0x00 0x01 0x03 0x80 0x0A 0x01 0x03 0x80 0x0A 0x7F;
    0x80 0xB4 0x05 0x00 0x19 0x06 0x06 0x80 0x10 0x02 0x03 0x80 0x0A 0x03 0x03 0x80 0x0A 0x07 0x03 0x80 0x0A 0x09 0x03 0x80 0x0A 0x04 0x03 0x80 0x0A 0x05 0x7F;
    0x80 0xBC 0x05 0x00 0x00 0x7F;
    // com/sun/javacard/samples/HelloWorld/javacard/RefLocation.cap
    0x80 0xB2 0x09 0x00 0x00 0x7F;
    0x80 0xB4 0x09 0x00 0x16 0x09 0x00 0x13 0x00 0x03 0x0E 0x26 0x2B 0x00 0x0C 0x05 0x0C 0x06 0x04 0x08 0x05 0x11 0x0C 0x07 0x09 0x06 0x09 0x7F;
    0x80 0xBC 0x09 0x00 0x00 0x7F;
    0x80 0xBA 0x00 0x00 0x00 0x7F;
    powerdown;

  • Apdu responses

    i have downloaded java card development kit and trying to run sample applets as described in development kit user's guide...successfully i completed the process to generate script file using scritgen tool but when i send apdu command to create applet instance to cref then apdu response is 0x6443 means applet not found for installation ...i don't know how to handle it....bcoz i face no prblem at any stage ...sucessfully i compile the java applet to generate class file then using converter i generate cap file and then using this cap file i generate script file using scriptgen tool...but when after prepending and appending powerup; and powerdown; and then appending create applet command i send this file using apdutool to cref(jcre) then 0x6444 response is given to me................why ? plz plz plz reply me soon bcoz here is no one to guide me ............i will wait reply
    thanks

    yes before creating applet instance i select that applet using SELECT apdu category.......and after powerup; command i select the on card installer.....my script file that i send to apdutool look like this
    powerup;
    //then select the installer applet using this command
    0x00 0xa4 0x04 0x00 0x09 0xa0 0x00 0x00 0x00 0x62 0x03 0x01 0x08 0x01 0x7f;
    //then create HelloWorld as
    0x80 0xb8 0x00 0x00 0x0b 0x09 here my applet AID
    powerdown;
    plz sir help me and reply me soon that why i m facing problems

  • Getting 6A82 error code while selecting PPSE(Proximity payment system environment) applet from device interface

    Hi,
    I am developing an Wallet app in Android. For this I have to select PPSE applet in secure element to update some data from my android app. But the problem is I could not select the PPSE from the app. I can select other applet like VMPA from my android app. But every time I send select APDU in secure element to select PPSE from my android app, I am getting error code 6A82.
    But I can select the PPSE from contactless nfc reader and also can see the PPSE is installed into my Secure Element.
    Is there any configuration that I should follow to make the PPSE selectable  from device interface?
    Please help me on this regard.
    Thanks in advance.

    Hi, Could you share more information about your software architecture? Which framework did you use to access the secure element, seek-for-android?
    For secure element, GP mandates the so-called access control.
    It is a standard that enables several parties to independently and securely manage their stakes in a single Secure Element. It can be ensured that only allowed Android applications are able to access specific Java Card applets depending on the device APK certificate.
    You should check whether your android application is allowed to access the PPSE or not. But for what you have described in your post, it seems to me that your app is not allowed.
    Hope that helps,
    BRs,
    JDL

  • Install error -look at the code. plz help

    I have the simple applet that I'm able to compile and load on to a JCOP10 cartd. When I try to install the applet so that I can start interacting with it, I get the following error. How do I go beyond this point? I'll appreciate your help.
    JCOP shell
    Load report:
    747 bytes loaded in 0.0 seconds
    effective code size on card:
    + package AID 6
    + applet AIDs 13
    + classes 21
    + methods 470
    + statics 0
    + exports 0
    overall 510 bytes
         end
         /set-var J 0
         while ${J} < ${PKG_${I}_APP_COUNT}
              install -i ${PKG_${I}_APP_${J}_INST_AID} -q C9#(${PKG_${I}_APP_${J}_INST_DATA}) ${PKG_${I}_AID} ${PKG_${I}_APP_${J}_AID}
    => 80 E6 0C 00 24 06 11 11 11 11 11 11 06 22 22 22 ....$........"""
    22 22 22 06 22 22 22 22 22 33 01 00 0B C9 09 23 """."""""3.....#
    42 38 47 36 74 63 76 73 00 00 B8G6tcvs..
    (0 msec)
    <= 6A 80 j.
    Status: Wrong data
    Error code: 6a80 (Wrong data)
    Offending APDU: 6A80
    Here is the code.
    * Package: myWallet
    * Filename: MyWallet.java
    * Class: MyWallet
    * Date: Jan 23, 2004 2:01:58 PM
    package myWallet;
    import javacard.framework.*;
    //import javacardx.framework.*;
    public class MyWallet extends Applet
    /* constants declaration */
    // code of CLA byte in the command APDU header
    final static byte Wallet_CLA =(byte)0x80;
    // codes of INS byte in the command APDU header
    final static byte VERIFY = (byte) 0x20;
    final static byte CREDIT = (byte) 0x30;
    final static byte DEBIT = (byte) 0x40;
    final static byte GET_BALANCE = (byte) 0x50;
    // maximum balance
    final static short MAX_BALANCE = (byte)0x7FFF;
    // maximum transaction amount
    final static byte MAX_TRANSACTION_AMOUNT =(byte)0x007F;
    // maximum number of incorrect tries before the
    // PIN is blocked
    final static byte PIN_TRY_LIMIT =(byte)0x03;
    // maximum size PIN
    final static byte MAX_PIN_SIZE =(byte)0x08;
    // signal that the PIN verification failed
    final static short SW_VERIFICATION_FAILED = 0x6300;
    // signal the the PIN validation is required
    // for a credit or a debit transaction
    final static short SW_PIN_VERIFICATION_REQUIRED =     0x6301;
    // signal invalid transaction amount
    // amount > MAX_TRANSACTION_AMOUNT or amount < 0
    final static short SW_INVALID_TRANSACTION_AMOUNT = 0x6A83;
    // signal that the balance exceed the maximum
    final static short SW_EXCEED_MAXIMUM_BALANCE = 0x6A84;
    // signal the the balance becomes negative
    final static short SW_NEGATIVE_BALANCE = 0x6A85;
    /* instance variables declaration */
    OwnerPIN pin;
    short balance;
    private MyWallet (byte[] bArray,short bOffset,byte bLength)
         // It is good programming practice to allocate
         // all the memory that an applet needs during
         // its lifetime inside the constructor
         pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
         byte iLen = bArray[bOffset]; // aid length
         bOffset = (short) (bOffset+iLen+1);
         byte cLen = bArray[bOffset]; // info length
         bOffset = (short) (bOffset+cLen+1);
         byte aLen = bArray[bOffset]; // applet data length
         // The installation parameters contain the PIN
         // initialization value
         pin.update(bArray, (short)(bOffset+1), aLen);
    register();
    } // end of the constructor
    public static void install(byte[] bArray, short bOffset, byte bLength){
         // create a Wallet applet instance
         MyWallet me = new MyWallet(bArray, bOffset, bLength);
    me.register(bArray, bOffset, bLength);
    } // end of install method
    public boolean select()
         // The applet declines to be selected
         // if the pin is blocked.
         if ( pin.getTriesRemaining() == 0 )
         return false;
         return true;
    }// end of select method
    public void deselect() {
         // reset the pin value
         pin.reset();
    public void process(APDU apdu) {
         // APDU object carries a byte array (buffer) to
         // transfer incoming and outgoing APDU header
         // and data bytes between card and CAD
         // At this point, only the first header bytes
         // [CLA, INS, P1, P2, P3] are available in
         // the APDU buffer.
         // The interface javacard.framework.ISO7816
         // declares constants to denote the offset of
         // these bytes in the APDU buffer
         byte[] buffer = apdu.getBuffer();
         // check SELECT APDU command
         buffer[ISO7816.OFFSET_CLA] = (byte)(buffer[ISO7816.OFFSET_CLA] & (byte)0xFC);
         if ((buffer[ISO7816.OFFSET_CLA] == 0) &&
         (buffer[ISO7816.OFFSET_INS] == (byte)(0xA4)) )
         return;
         // verify the reset of commands have the
         // correct CLA byte, which specifies the
         // command structure
         if (buffer[ISO7816.OFFSET_CLA] != Wallet_CLA)
         ISOException.throwIt
    (ISO7816.SW_CLA_NOT_SUPPORTED);
         switch (buffer[ISO7816.OFFSET_INS]) {
         case GET_BALANCE: getBalance(apdu);
                                  return;
         case DEBIT: debit(apdu);
                                  return;
         case CREDIT: credit(apdu);
                                  return;
         case VERIFY: verify(apdu);
                                  return;
         default: ISOException.throwIt (ISO7816.SW_INS_NOT_SUPPORTED);
    } // end of process method
    private void credit(APDU apdu)
    // access authentication
    if ( ! pin.isValidated() )
    ISOException.throwIt(
              SW_PIN_VERIFICATION_REQUIRED);
         byte[] buffer = apdu.getBuffer();
         // Lc byte denotes the number of bytes in the
         // data field of the command APDU
         byte numBytes = buffer[ISO7816.OFFSET_LC];
         // indicate that this APDU has incoming data
         // and receive data starting from the offset
         // ISO7816.OFFSET_CDATA following the 5 header
         // bytes.
         byte byteRead =
                   (byte)(apdu.setIncomingAndReceive());
         // it is an error if the number of data bytes
         // read does not match the number in Lc byte
         if ( ( numBytes != 1 ) || (byteRead != 1) )
         ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
         // get the credit amount
         byte creditAmount = buffer[ISO7816.OFFSET_CDATA];
         // check the credit amount
         if ( ( creditAmount > MAX_TRANSACTION_AMOUNT)
              || ( creditAmount < 0 ) )
              ISOException.throwIt
                        (SW_INVALID_TRANSACTION_AMOUNT);
         // check the new balance
         if ( (short)( balance + creditAmount) > MAX_BALANCE )
         ISOException.throwIt
                             (SW_EXCEED_MAXIMUM_BALANCE);
         // credit the amount
         balance = (short)(balance + creditAmount);
    } // end of deposit method
    private void debit(APDU apdu)
         // access authentication
         if ( ! pin.isValidated() )
         ISOException.throwIt
    (SW_PIN_VERIFICATION_REQUIRED);
         byte[] buffer = apdu.getBuffer();
         byte numBytes =
                   (byte)(buffer[ISO7816.OFFSET_LC]);
         byte byteRead =
                   (byte)(apdu.setIncomingAndReceive());
         if ( ( numBytes != 1 ) || (byteRead != 1) )
         ISOException.throwIt
                                  (ISO7816.SW_WRONG_LENGTH);
         // get debit amount
         byte debitAmount =
                             buffer[ISO7816.OFFSET_CDATA];
         // check debit amount
         if ( ( debitAmount > MAX_TRANSACTION_AMOUNT)
              || ( debitAmount < 0 ) )
         ISOException.throwIt
                        (SW_INVALID_TRANSACTION_AMOUNT);
         // check the new balance
         if ( (short)( balance - debitAmount ) < (short)0 )
              ISOException.throwIt(SW_NEGATIVE_BALANCE);
         balance = (short) (balance - debitAmount);
    } // end of debit method
    private void getBalance(APDU apdu) {
         byte[] buffer = apdu.getBuffer();
         // inform system that the applet has finished
         // processing the command and the system should
         // now prepare to construct a response APDU
         // which contains data field
         short le = apdu.setOutgoing();
         if ( le < 2 )
         ISOException.throwIt
                             (ISO7816.SW_WRONG_LENGTH);
         //informs the CAD the actual number of bytes
         //returned
         apdu.setOutgoingLength((byte)2);
         // move the balance data into the APDU buffer
         // starting at the offset 0
         buffer[0] = (byte)(balance >> 8);
         buffer[1] = (byte)(balance & 0xFF);
         // send the 2-byte balance at the offset
         // 0 in the apdu buffer
         apdu.sendBytes((short)0, (short)2);
    } // end of getBalance method
    private void verify(APDU apdu) {
         byte[] buffer = apdu.getBuffer();
         // retrieve the PIN data for validation.
    byte byteRead =(byte)(apdu.setIncomingAndReceive());
    // check pin
         // the PIN data is read into the APDU buffer
    // at the offset ISO7816.OFFSET_CDATA
    // the PIN data length = byteRead
    if ( pin.check(buffer, ISO7816.OFFSET_CDATA,byteRead) == false )
         ISOException.throwIt(SW_VERIFICATION_FAILED);
    } // end of validate method
    } // end of class Wallet

    How do I set a breakpoint in my install method in order to identify the error?
    I've tried changing my install method and making it look exactly like the sample wallet applications accompanying the javacard kit, but I'm still getting the same error? here else could be the possible source of the error?
    Thomas

  • Return code = 00000057 using a gem pc twin reader with OCF

    Hello, i really need help.
    I'm having the famous return code = 00000057 when i try to send an APDU command, I'm using a applet proxy, so it send an select APDU inside the OCF framework, and the result is success, so i'm able to send an select Applet, but when i try to send the following apdu:
    allocateCardChannel();
    // Set up the command APDU and send it to the card.
    getBalanceAPDU.setLength(0);
    getBalanceAPDU.append(MyAPPLET_CLA); // Class
    getBalanceAPDU.append(VERIFY_INS); // Instr'n
    getBalanceAPDU.append((byte) 0x00); // P1
    getBalanceAPDU.append((byte) 0x00); // P2
    getBalanceAPDU.append((byte) 0x00); // Lc
    getBalanceAPDU.append((byte) 0x05); // Le
    // Send command APDU and check the response.
    ResponseAPDU response;
    //response = new ResponseAPDU(07);
    response = sendCommandAPDU(getCardChannel(), MY_CARD_AID,
    getBalanceAPDU);
    i got that error. I pasted, all the debug message below. I already updated the pcsc-wrapper-2.0.jar file, but i'm still having this error, as i said i'm using an gem pc twin cardreader with gemxpresso card. My opencard.properties file:
    # Card service configuration #
    OpenCard.services = com.ibm.opencard.factory.MFCCardServiceFactory \
    opencard.opt.util.PassThruCardServiceFactory \
    br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    #OpenCard.services = br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    # Card terminal configuration #
    #OpenCard.terminals = GemplusCardTerminalFactory
    OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|Autodetect|*|SHARED
    #OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory
    #OpenCard.terminals=com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|myGEMPlus|GEM430PC|SHARED
    # Trace configuration #
    OpenCard.trace = opencard:9
    ----- the debug----
    [DEBUG    ] opencard.core.service.SmartCard.getRegistryEntry
    --- message tag OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|Autodetect|*|SHARED
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.terminal.CardTerminal.<init>
    --- message (Gemplus USB Smart Card Reader 0, PCSC10, )
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.terminal.CardTerminal
    [DEBUG    ] opencard.core.event.EventGenerator.updateTerminals
    --- message new pollable Terminal = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.event.EventGenerator
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.cardInserted
    --- message slotID 0, )
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] opencard.core.event.EventGenerator.updateCards
    --- message card inserted slotID = 0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.event.EventGenerator
    [DEBUG    ] opencard.core.service.SmartCard.getRegistryEntry
    --- message tag OpenCard.services = com.ibm.opencard.factory.MFCCardServiceFactory opencard.opt.util.PassThruCardServiceFactory br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.opt.service.OCF11CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.service.OCF11CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message opencard.opt.util.PassThruCardServiceFactory@94cc7
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message [email protected]fa0f0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    [DEBUG    ] opencard.core.service.SmartCard.<start>
    --- message finished
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message CTEvent opencard.core.event.CardTerminalEvent[source=com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr ]
    ---source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    ---id 1
    card inserted in slot 0
    terminal com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.openSlotChannel
    --- message for slot #0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.openSlotChannel
    --- message new SlotChannel is opencard.core.terminal.SlotChannel@182815a
    + state open
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] opencard.core.service.CardServiceRegistry.allocateCardServiceScheduler
    --- message instantiating CardServiceScheduler
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceScheduler.<init>
    --- message slotChannel opencard.core.terminal.SlotChannel@182815a
    + state open
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceScheduler
    [DEBUG    ] opencard.core.service.CardChannel.<init>
    --- message (opencard.core.terminal.SlotChannel@182815a
    + state open)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardChannel
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message using CardServiceScheduler opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceScheduler.createSmartCard
    --- message creating SmartCard
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.SmartCard.<init>
    --- message scheduler opencard.core.service.CardServiceScheduler@4ab8b9, is alive, cid opencard.core.terminal.CardID@1a5ba75 ATR: 3B 7D 94 00 00 80 31 80 65 B0 83 01 02 90 83 00
    90 00
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.SmartCard.getCardService
    --- message (class br.com.neac.petrobras.medidorgas.process.NastekCardProxy)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.SmartCard@fb7efa
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message for class br.com.neac.petrobras.medidorgas.process.NastekCardProxy from opencard.core.service.SmartCard@fb7efa
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message checking [email protected]c68b6f
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardService.<init>
    --- message default constructor of br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardService
    [DEBUG    ] opencard.opt.applet.AppletProxy.<init>
    --- message (A0 00 00 00 62 03 01 0C 02,opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa,true)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.AppletProxy
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.initialize
    --- message (opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.<init>
    --- message (opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa,true)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    BasicAppletCardService - allocated CardChannel()
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message factory [email protected]c68b6f produced br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.sendCommandAPDU(channel,...)
    --- message sending opencard.core.terminal.CommandAPDU@1d92803
    0000: 00 20 00 00 00 05 . ....
    to <A0 00 00 00 62 03 01 0C 02>
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.selectApplet
    --- message selecting A0 00 00 00 62 03 01 0C 02
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] opencard.opt.applet.ISOAppletSelector.selectApplet
    --- message selecting A0 00 00 00 62 03 01 0C 02
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.ISOAppletSelector
    [DEBUG    ] opencard.core.service.CardChannel.sendCommandAPDU
    --- message opencard.core.terminal.CommandAPDU@1d206f0
    0000: 00 A4 04 00 09 A0 00 00 00 62 03 01 0C 02 00 .........b.....
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] opencard.core.service.CardChannel.response:
    --- message opencard.core.terminal.ResponseAPDU@1f23f8b
    0000: 90 00 ..
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] opencard.opt.applet.ISOAppletSelector.selectApplet
    --- message Selection response sw = 0x9000
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.ISOAppletSelector
    [DEBUG    ] opencard.core.service.CardChannel.sendCommandAPDU
    --- message opencard.core.terminal.CommandAPDU@1d92803
    0000: 00 20 00 00 00 05 . ....
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    opencard.core.terminal.CardTerminalException: Pcsc10CardTerminal: PCSC Exception in method SCardTransmit: error occurred with SCardTransmit
    return code = 00000057
    at com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.translatePcscException(Pcsc10CardTerminal.java:502)

    Hello, i really need help.
    I'm having the famous return code = 00000057 when i try to send an APDU command, I'm using a applet proxy, so it send an select APDU inside the OCF framework, and the result is success, so i'm able to send an select Applet, but when i try to send the following apdu:
    allocateCardChannel();
    // Set up the command APDU and send it to the card.
    getBalanceAPDU.setLength(0);
    getBalanceAPDU.append(MyAPPLET_CLA); // Class
    getBalanceAPDU.append(VERIFY_INS); // Instr'n
    getBalanceAPDU.append((byte) 0x00); // P1
    getBalanceAPDU.append((byte) 0x00); // P2
    getBalanceAPDU.append((byte) 0x00); // Lc
    getBalanceAPDU.append((byte) 0x05); // Le
    // Send command APDU and check the response.
    ResponseAPDU response;
    //response = new ResponseAPDU(07);
    response = sendCommandAPDU(getCardChannel(), MY_CARD_AID,
    getBalanceAPDU);
    i got that error. I pasted, all the debug message below. I already updated the pcsc-wrapper-2.0.jar file, but i'm still having this error, as i said i'm using an gem pc twin cardreader with gemxpresso card. My opencard.properties file:
    # Card service configuration #
    OpenCard.services = com.ibm.opencard.factory.MFCCardServiceFactory \
    opencard.opt.util.PassThruCardServiceFactory \
    br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    #OpenCard.services = br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    # Card terminal configuration #
    #OpenCard.terminals = GemplusCardTerminalFactory
    OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|Autodetect|*|SHARED
    #OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory
    #OpenCard.terminals=com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|myGEMPlus|GEM430PC|SHARED
    # Trace configuration #
    OpenCard.trace = opencard:9
    ----- the debug----
    [DEBUG    ] opencard.core.service.SmartCard.getRegistryEntry
    --- message tag OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|Autodetect|*|SHARED
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.terminal.CardTerminal.<init>
    --- message (Gemplus USB Smart Card Reader 0, PCSC10, )
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.terminal.CardTerminal
    [DEBUG    ] opencard.core.event.EventGenerator.updateTerminals
    --- message new pollable Terminal = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.event.EventGenerator
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.cardInserted
    --- message slotID 0, )
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] opencard.core.event.EventGenerator.updateCards
    --- message card inserted slotID = 0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.event.EventGenerator
    [DEBUG    ] opencard.core.service.SmartCard.getRegistryEntry
    --- message tag OpenCard.services = com.ibm.opencard.factory.MFCCardServiceFactory opencard.opt.util.PassThruCardServiceFactory br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.opt.service.OCF11CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.service.OCF11CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message opencard.opt.util.PassThruCardServiceFactory@94cc7
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message [email protected]fa0f0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    [DEBUG    ] opencard.core.service.SmartCard.<start>
    --- message finished
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message CTEvent opencard.core.event.CardTerminalEvent[source=com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr ]
    ---source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    ---id 1
    card inserted in slot 0
    terminal com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.openSlotChannel
    --- message for slot #0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.openSlotChannel
    --- message new SlotChannel is opencard.core.terminal.SlotChannel@182815a
    + state open
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] opencard.core.service.CardServiceRegistry.allocateCardServiceScheduler
    --- message instantiating CardServiceScheduler
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceScheduler.<init>
    --- message slotChannel opencard.core.terminal.SlotChannel@182815a
    + state open
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceScheduler
    [DEBUG    ] opencard.core.service.CardChannel.<init>
    --- message (opencard.core.terminal.SlotChannel@182815a
    + state open)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardChannel
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message using CardServiceScheduler opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceScheduler.createSmartCard
    --- message creating SmartCard
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.SmartCard.<init>
    --- message scheduler opencard.core.service.CardServiceScheduler@4ab8b9, is alive, cid opencard.core.terminal.CardID@1a5ba75 ATR: 3B 7D 94 00 00 80 31 80 65 B0 83 01 02 90 83 00
    90 00
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.SmartCard.getCardService
    --- message (class br.com.neac.petrobras.medidorgas.process.NastekCardProxy)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.SmartCard@fb7efa
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message for class br.com.neac.petrobras.medidorgas.process.NastekCardProxy from opencard.core.service.SmartCard@fb7efa
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message checking [email protected]c68b6f
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardService.<init>
    --- message default constructor of br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardService
    [DEBUG    ] opencard.opt.applet.AppletProxy.<init>
    --- message (A0 00 00 00 62 03 01 0C 02,opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa,true)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.AppletProxy
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.initialize
    --- message (opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.<init>
    --- message (opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa,true)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    BasicAppletCardService - allocated CardChannel()
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message factory [email protected]c68b6f produced br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.sendCommandAPDU(channel,...)
    --- message sending opencard.core.terminal.CommandAPDU@1d92803
    0000: 00 20 00 00 00 05 . ....
    to <A0 00 00 00 62 03 01 0C 02>
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.selectApplet
    --- message selecting A0 00 00 00 62 03 01 0C 02
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] opencard.opt.applet.ISOAppletSelector.selectApplet
    --- message selecting A0 00 00 00 62 03 01 0C 02
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.ISOAppletSelector
    [DEBUG    ] opencard.core.service.CardChannel.sendCommandAPDU
    --- message opencard.core.terminal.CommandAPDU@1d206f0
    0000: 00 A4 04 00 09 A0 00 00 00 62 03 01 0C 02 00 .........b.....
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] opencard.core.service.CardChannel.response:
    --- message opencard.core.terminal.ResponseAPDU@1f23f8b
    0000: 90 00 ..
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] opencard.opt.applet.ISOAppletSelector.selectApplet
    --- message Selection response sw = 0x9000
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.ISOAppletSelector
    [DEBUG    ] opencard.core.service.CardChannel.sendCommandAPDU
    --- message opencard.core.terminal.CommandAPDU@1d92803
    0000: 00 20 00 00 00 05 . ....
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    opencard.core.terminal.CardTerminalException: Pcsc10CardTerminal: PCSC Exception in method SCardTransmit: error occurred with SCardTransmit
    return code = 00000057
    at com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.translatePcscException(Pcsc10CardTerminal.java:502)

Maybe you are looking for

  • I do I make purchased music not show up on my iPhone?

    I have purchased music through iTunes on my iPhone. On the computer I convert the MP4 of the purchased music into MP3 and put it in my own created music folders and put back on the phone in my playlists. The only thing is is that the music now shows

  • Compiling Error While Viewing XML Data in Word

    I received the following message, "Compile error in hidden module: Module_starter" while trying to load sample xml data to view within MS Word while using BI Publisher. Any ideas of what causes this and how to fix it would be greatly appreciated. Tha

  • I want to cancel BT in the summer

    Hi all, I currently have a broadband/BT Vision package on a 24 month contract. I took this out in August 2010, so I'm not too far from the end of the contract. I do not wish to renew it; I want to go with Sky or Virgin Media instead. Can anyone pleas

  • Af:query on not working for time in adf 11.6

    HI , In af:query we have date field ,which displays on format of hh.:mm . When i try to search the field with HH:mm format the table records not filtering any records(Not getting any records ) table column data type of field is Date (Table display fi

  • Interface tables/views

    Hello, After reading some EBS doc, I have some doubts. What I want to do is to integrate the EBS with other product (use EBS as a datasource of this product). The first step I did was trying to connect via JDBC driver to the EBS and it was successful