6 Replies Latest reply: Apr 27, 2013 11:48 AM by 999919 RSS

    I cannot load my java card applet Response APDU: 69 85

    999919
      I know there have been many threads on this subject, I am a newbie to Java card development.
      Please someone help me.
      I am using the gpj for downloading the applet.
      The following is the output from the command "java -jar gpj.jar -load JCHelloWorld.cap -install"
      Thanks in advance

      run:
      Found terminals: [PC/SC terminal Generic PCSC Smartcard Reader 0]
      Found card in terminal: Generic PCSC Smartcard Reader 0
      ATR: 3B DB 96 00 80 B1 FE 45 1F 83 00 31 C0 64 C7 FC 10 00 01 90 00 74
      INFO: Selecting Security Domain OP201a, AID=A000000003000000
      DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
      DEBUG: Response APDU: 6F 6E 84 08 A0 00 00 00 03 00 00 00 A5 62 73 2F 06 07 2A 86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B 02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64 0B 06 09 2A 86 48 86 FC 6B 04 01 05 9F 6E 2A 48 20 50 2B 82 31 80 30 00 63 03 12 63 00 07 BB 03 00 11 42 12 97 11 43 12 97 11 44 12 97 01 00 00 00 00 00 00 00 00 00 00 00 9F 65 01 FF 90 00
      Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
      DEBUG: Command APDU: 80 50 00 00 08 FC 81 DB FE 80 72 19 28
      DEBUG: Response APDU: 00 00 03 12 63 00 07 BB 03 00 FF 01 DA 26 EF 49 10 B7 72 00 9A 24 7F B4 A0 1F C7 C8 90 00
      INFO: INITIALIZE UPDATE Successful
      DEBUG: Command APDU: 84 82 00 00 10 D5 41 CE BE F4 A8 E4 DD 36 6C C5 3E 19 9C 77 93
      DEBUG: Response APDU: 90 00
      DEBUG: Command APDU: 84 82 00 00 08 D5 41 CE BE F4 A8 E4 DD
      DEBUG: Response APDU: 90 00
      INFO: External Authentication Successful
      DEBUG: packagePath: com/samptah/card/javacard/
      DEBUG: package: com.samptah.card
      DEBUG: package AID: 9C 25 F6 5E AB 3F
      DEBUG: applet AIDs: [9C 25 F6 5E AB CD ]
      DEBUG: Command APDU: 80 E6 02 00 13 06 9C 25 F6 5E AB 3F 08 A0 00 00 00 03 00 00 00 00 00 00
      DEBUG: Response APDU: 00 90 00

      DEBUG: Command APDU: 80 E8 00 00 FF C4 82 01 4C 01 00 10 DE CA FF ED 01 02 04 00 01 06 9C 25 F6 5E AB 3F 02 00 1F 00 10 00 1F 00 0A 00 15 00 2E 00 0C 00 7F 00 18 00 12 00 00 00 6F 00 02 00 01 00 0B 02 01 00 04 00 15 02 04 01 07 A0 00 00 00 62 01 01 00 01 07 A0 00 00 00 62 00 01 03 00 0A 01 06 9C 25 F6 5E AB CD 00 08 06 00 0C 00 80 03 00 FF 00 07 01 00 00 00 1C 07 00 7F 00 01 10 18 8C 00 00 7A 05 30 8F 00 01 3D 8C 00 02 18 1D 04 41 18 1D 25 8B 00 03 7A 02 23 18 8B 00 04 60 03 7A 19 8B 00 05 2D 1A 03 25 11 00 FF 53 5B 32 1A 04 25 11 00 FF 53 5B 29 04 1F 10 80 6A 08 11 6E 00 8D 00 06 16 04 75 00 10 00 01 00 00 00 09 18 19 8C 00 07 70 08 11 6D 00 8D 00 06 7A 05 22 19 8B 00 05 2D 7B 00 08 92 32 7B 00 08 03 1A 03 1F 8D 00 09 3B 19 03 1F 8B 00 0A 7A 08 00 18 00 02 00 01 00 01 03 00 0B 48 65 6C 6C
      DEBUG: Response APDU: 69 85
      net.sourceforge.gpj.cardservices.exceptions.GPLoadException: Load failed, SW: 69 85
      at net.sourceforge.gpj.cardservices.GlobalPlatformService.loadCapFile(GlobalPlatformService.java:707)
      at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(GlobalPlatformService.java:1675)
      at gpj.Main.main(Main.java:26)
      BUILD SUCCESSFUL (total time: 1 second)
        • 1. Re: I cannot load my java card applet Response APDU: 69 85
          1001855
          SW AID EXIST
          or
          LOADFILE EXISTED

          you can delete your cap first
          • 2. Re: I cannot load my java card applet Response APDU: 69 85
            999919
            Thanks a lot. After deleting I managed to load the applet successfully.

            Found terminals: [PC/SC terminal Generic PCSC Smartcard Reader 0]
            Found card in terminal: Generic PCSC Smartcard Reader 0
            ATR: 3B DB 96 00 80 B1 FE 45 1F 83 00 31 C0 64 C7 FC 10 00 01 90 00 74
            INFO: Selecting Security Domain OP201a, AID=A000000003000000
            DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
            DEBUG: Response APDU: 6F 6E 84 08 A0 00 00 00 03 00 00 00 A5 62 73 2F 06 07 2A 86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B 02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64 0B 06 09 2A 86 48 86 FC 6B 04 01 05 9F 6E 2A 48 20 50 2B 82 31 80 30 00 63 03 12 63 00 07 BB 03 00 11 42 12 97 11 43 12 97 11 44 12 97 01 00 00 00 00 00 00 00 00 00 00 00 9F 65 01 FF 90 00
            Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
            DEBUG: Command APDU: 80 50 00 00 08 1E 79 D5 15 FC 99 A0 21
            DEBUG: Response APDU: 00 00 03 12 63 00 07 BB 03 00 FF 01 98 51 88 7C 99 76 47 4A FA B4 A2 12 76 40 2B EA 90 00
            INFO: INITIALIZE UPDATE Successful
            DEBUG: Command APDU: 84 82 00 00 10 7E 4B E6 D1 77 CB 2D A6 A4 C6 EF 53 59 06 F7 91
            DEBUG: Response APDU: 90 00
            DEBUG: Command APDU: 84 82 00 00 08 7E 4B E6 D1 77 CB 2D A6
            DEBUG: Response APDU: 90 00
            INFO: External Authentication Successful
            DEBUG: packagePath: com/sampath/javacard/wallet/javacard/
            DEBUG: package: com.sampath.javacard.wallet
            DEBUG: package AID: A0 00 00 00 62 03 01 0C 01
            DEBUG: applet AIDs: [A0 00 00 00 62 03 01 0C 01 01 ]
            DEBUG: Command APDU: 80 E6 02 00 16 09 A0 00 00 00 62 03 01 0C 01 08 A0 00 00 00 03 00 00 00 00 00 00
            DEBUG: Response APDU: 00 90 00
            INFO: INSTALL FOR LOAD Command successful
            DEBUG: Command APDU: 80 E8 00 00 FF C4 82 02 F1 01 00 13 DE CA FF ED 01 02 04 00 01 09 A0 00 00 00 62 03 01 0C 01 02 00 1F 00 13 00 1F 00 0E 00 0B 00 6A 00 12 01 C7 00 0A 00 3E 00 00 00 E2 00 00 00 00 00 00 01 01 00 04 00 0B 01 00 01 07 A0 00 00 00 62 01 01 03 00 0E 01 0A A0 00 00 00 62 03 01 0C 01 01 00 3F 06 00 12 00 80 03 03 00 01 04 04 00 00 00 51 FF FF 00 4D 00 59 07 01 C7 00 05 41 18 8C 00 05 18 10 2D 89 00 18 03 89 01 19 1E 25 29 04 16 04 1E 06 41 41 29 04 18 8F 00 03 3D 06 10 08 8C 00 04 87 02 AD 02 19 16 04 05 8B 00 06 18 19 1E 04 41 19 1E 25 8B 00 07 7A 05 30 8F 00 08 3D 18 1D 1E 8C 00 09 3B 7A 01 10 04 78 01 10 AD 02 8B 00 0A 7A 02 21 19 8B 00 0B 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 0C 1A 04 25 75 00 2D 00 04 00 20 00 27 00 30 00 21 00 40
            DEBUG: Response APDU: 00 90 00
            DEBUG: Command APDU: 80 E8 00 01 FF 00 1B 00 50 00 15 18 19 8C 00 0D 7A 18 19 8C 00 0E 7A 18 19 8C 00 0F 7A 18 19 8C 00 10 7A 11 6D 00 8D 00 0C 7A 03 24 AD 02 8B 00 11 61 08 11 63 01 8D 00 0C 19 8B 00 0B 2D 1A 07 25 32 19 8B 00 12 5B 29 04 1F 04 6B 07 16 04 04 6A 08 11 67 00 8D 00 0C 1A 08 25 29 05 16 05 10 7F 6E 06 16 05 63 08 11 6A 83 8D 00 0C AF 00 16 05 41 11 7F FF 6F 08 11 6A 84 8D 00 0C 8D 00 13 18 AF 00 16 05 41 89 00 8D 00 14 7A 03 24 AD 02 8B 00 11 61 08 11 63 01 8D 00 0C 19 8B 00 0B 2D 1A 07 25 32 19 8B 00 12 5B 29 04 1F 04 6B 07 16 04 04 6A 08 11 67 00 8D 00 0C 1A 08 25 29 05 16 05 10 7F 6E 06 16 05 63 08 11 6A 83 8D 00 0C AF 00 16 05 43 63 08 11 6A 85 8D 00 0C 18 AF 00 16 05 43 89 00 7A 04 22 19 8B 00 0B 2D 19 8B 00 15 32 1F 05 6D 08 11 67 00 8D 00 0C 19 05 8B 00 16 1A 03 AF 00
            DEBUG: Response APDU: 00 90 00
            DEBUG: Command APDU: 80 E8 80 02 F7 10 08 4F 5B 38 1A 04 AF 00 11 00 FF 53 5B 38 1A 03 AF 00 8D 00 17 3B 19 03 05 8B 00 18 7A 04 22 19 8B 00 0B 2D 19 8B 00 12 5B 32 AD 02 1A 08 1F 8B 00 19 61 08 11 63 00 8D 00 0C 7A 08 00 0A 00 00 00 00 00 00 00 00 00 00 05 00 6A 00 1A 02 00 00 01 02 00 00 02 02 00 00 00 01 80 09 00 06 80 09 00 06 80 03 00 03 80 09 08 03 80 03 02 01 00 00 00 06 00 00 01 03 80 09 05 03 80 0A 01 06 80 07 01 06 00 01 6C 06 00 01 13 06 00 00 B1 06 00 01 A9 03 80 09 04 03 80 0A 06 06 80 08 01 06 80 08 02 03 80 0A 07 03 80 0A 09 06 80 10 06 03 80 0A 04 03 80 09 01 09 00 3E 00 11 0B 04 1A 02 29 60 41 14 05 08 41 0E 05 20 09 0A 1A 00 29 05 1A 07 0B 0B 06 07 0D 07 1B 1D 06 06 06 07 08 08 04 09 12 15 10 03 0B 08 08 04 09 12 15 0D 0F 05 0B 05 1A 07 07 05 0A 08
            DEBUG: Response APDU: 00 90 00
            DEBUG: Command APDU: 80 E6 0C 00 27 09 A0 00 00 00 62 03 01 0C 01 0A A0 00 00 00 62 03 01 0C 01 01 0A A0 00 00 00 62 03 01 0C 01 01 01 00 03 C9 77 77 00
            DEBUG: Response APDU: 00 90 00
            • 3. Re: I cannot load my java card applet Response APDU: 69 85
              975608
              Quite similar problem here. Here's what I got from GPShell:
              enable_trace
              establish_context
              card_connect
              select -AID a0000000030000
              Command --> 00A4040007A0000000030000
              Wrapped command --> 00A4040007A0000000030000
              Response <-- 6F658408A000000003000000A5599F6501FF9F6E06479181023100734A06072A864
              886FC6B01600C060A2A864886FC6B02020101630906072A864886FC6B03640B06092A864886FC6B0
              40215650B06092B8510864864020103660C060A2B060104012A026E01029000
              open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
              f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
              Command --> 805000000804C1C46CBC9932AA00
              Wrapped command --> 805000000804C1C46CBC9932AA00
              Response <-- 000010700108859552580101AA4F3AEC5503E7A7435A0560E047AF489000
              Command --> 84820100100C2766279A1FC158181037B7A811AB93
              Wrapped command --> 84820100100C2766279A1FC158181037B7A811AB93
              Response <-- 9000
              delete -AID D0D1D2D3D4D50101
              Command --> 80E400000A4F08D0D1D2D3D4D5010100
              Wrapped command --> 84E40000124F08D0D1D2D3D4D501014018673D5E89975900
              Response <-- 6A88
              delete() returns 0x80206A88 (6A88: Referenced data not found.)
              delete -AID D0D1D2D3D4D501
              Command --> 80E40000094F07D0D1D2D3D4D50100
              Wrapped command --> 84E40000114F07D0D1D2D3D4D501887135A5C0B424D500
              Response <-- 6A88
              delete() returns 0x80206A88 (6A88: Referenced data not found.)
              delete -AID D0D1D2D3D4D50101
              Command --> 80E400000A4F08D0D1D2D3D4D5010100
              Wrapped command --> 84E40000124F08D0D1D2D3D4D501017144DF5DE0D2DE9F00
              Response <-- 6A88
              delete() returns 0x80206A88 (6A88: Referenced data not found.)
              install -file helloworld.cap -nvDataLimit 500 -instParam 00 -priv 2
              Command --> 80E602001907D0D1D2D3D4D50107A00000000300000006EF04C60201600000
              Wrapped command --> 84E602002107D0D1D2D3D4D50107A00000000300000006EF04C602016000
              C6EDAE8F91652A3B00
              Response <-- 6A88
              install_for_load() returns 0x80206A88 (6A88: Referenced data not found.)
              And this is what I've got from gpj
              Found terminals: [PC/SC terminal ACS ACR1281 1S Dual Reader ICC 0, PC/SC termina
              l ACS ACR1281 1S Dual Reader PICC 0, PC/SC terminal ACS ACR1281 1S Dual Reader S
              AM 0]
              Found card in terminal: ACS ACR1281 1S Dual Reader ICC 0
              ATR: 3B F8 18 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 BC
              DEBUG: Command  APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00
              DEBUG: Response APDU: 6A 82
              Failed to select Security Domain GP211 A0 00 00 01 51 00 00 , SW: 6A 82
              DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 18 43 4D 00
              DEBUG: Response APDU: 6A 82
              Failed to select Security Domain GemaltoXpressPro A0 00 00 00 18 43 4D 00 , SW:
              6A 82
              DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
              DEBUG: Response APDU: 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65 01 FF 9F 6
              E 06 47 91 81 02 31 00 73 4A 06 07 2A 86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86
              FC 6B 02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64 0B 06 09 2A 86 48 86 FC 6B
               04 02 15 65 0B 06 09 2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01 04 01 2A 0
              2 6E 01 02 90 00
              Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
              DEBUG: Command  APDU: 80 50 00 00 08 A5 6A EB 5F E3 31 30 37
              DEBUG: Response APDU: 00 00 10 70 01 08 85 95 52 58 01 01 2E 43 22 1A A3 0A 65 4
              0 AA 8B D1 2A D5 89 8D 70 90 00
              DEBUG: Command  APDU: 84 82 00 00 10 B8 3A E1 AD 36 01 D8 E3 5F CC 77 B4 A7 F2 B
              E 68
              DEBUG: Response APDU: 90 00
              DEBUG: Command  APDU: 84 82 00 00 08 B8 3A E1 AD 36 01 D8 E3
              DEBUG: Response APDU: 90 00
              DEBUG: packagePath: com/tru/card/javacard/
              DEBUG: package: com.tru.card
              DEBUG: package AID: C3 79 3E 65 A1 00 EB F3 FD 20
              DEBUG: applet AIDs: [C3 79 3E 65 A1 C9 85 3B ]
              DEBUG: Command  APDU: 80 E6 02 00 17 0A C3 79 3E 65 A1 00 EB F3 FD 20 08 A0 00 0
              0 00 03 00 00 00 00 00 00
              DEBUG: Response APDU: 00 90 00
              DEBUG: Command  APDU: 80 E6 02 00 17 0A C3 79 3E 65 A1 00 EB F3 FD 20 08 A0 00 0
              0 00 03 00 00 00 00 00 00
              DEBUG: Response APDU: 00 90 00
              DEBUG: Command  APDU: 80 E8 00 00 FF C4 82 04 32 01 00 14 DE CA FF ED 01 02 04 0
              0 01 0A C3 79 3E 65 A1 00 EB F3 FD 20 02 00 1F 00 14 00 1F 00 0C 00 15 00 86 00
              12 02 CE 00 0A 00 53 00 00 00 F9 00 00 00 00 00 00 02 01 00 04 00 15 02 04 01 07
               A0 00 00 00 62 01 01 00 01 07 A0 00 00 00 62 00 01 03 00 0C 01 08 C3 79 3E 65 A
              1 C9 85 3B 00 01 06 00 12 00 80 03 0C 00 06 04 04 00 00 00 0C FF FF FF FF 01 27
              07 02 CE 00 02 30 8F 00 0C 3D 8C 00 0E 3B 7A 01 10 18 8C 00 0D AD 00 8B 00 0F 7A
               05 10 18 8C 00 10 18 10 08 88 01 18 11 3F 02 89 02 18 11 3F 03 89 03 18 11 3F 0
              4 89 04 18 11 3F 05 89 05 18 8B 00 1E 18 10 08 90 0B 3D 03 10 54 38 3D 04 10 52
              38 3D 05 10 55 38 3D 06 10 53 38 3D 07 10 4D 38 3D 08 10 41 38 3D 10 06 10 52 38
               3D 10 07 10 54 38 87 06 18 10 06 90 0B 3D 03 10 54 38 3D 04 10 53 38 3D 05 10 4
              3
              DEBUG: Response APDU: 6A 80
              DEBUG: Command  APDU: 80 E8 00 00 FF C4 82 04 32 01 00 14 DE CA FF ED 01 02 04 0
              0 01 0A C3 79 3E 65 A1 00 EB F3 FD 20 02 00 1F 00 14 00 1F 00 0C 00 15 00 86 00
              12 02 CE 00 0A 00 53 00 00 00 F9 00 00 00 00 00 00 02 01 00 04 00 15 02 04 01 07
               A0 00 00 00 62 01 01 00 01 07 A0 00 00 00 62 00 01 03 00 0C 01 08 C3 79 3E 65 A
              1 C9 85 3B 00 01 06 00 12 00 80 03 0C 00 06 04 04 00 00 00 0C FF FF FF FF 01 27
              07 02 CE 00 02 30 8F 00 0C 3D 8C 00 0E 3B 7A 01 10 18 8C 00 0D AD 00 8B 00 0F 7A
               05 10 18 8C 00 10 18 10 08 88 01 18 11 3F 02 89 02 18 11 3F 03 89 03 18 11 3F 0
              4 89 04 18 11 3F 05 89 05 18 8B 00 1E 18 10 08 90 0B 3D 03 10 54 38 3D 04 10 52
              38 3D 05 10 55 38 3D 06 10 53 38 3D 07 10 4D 38 3D 08 10 41 38 3D 10 06 10 52 38
               3D 10 07 10 54 38 87 06 18 10 06 90 0B 3D 03 10 54 38 3D 04 10 53 38 3D 05 10 4
              3
              DEBUG: Response APDU: 6A 80
              net.sourceforge.gpj.cardservices.exceptions.GPLoadException: Load failed, SW: 6A
               80
                      at net.sourceforge.gpj.cardservices.GlobalPlatformService.loadCapFile(Un
              known Source)
                      at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(Unknown S
              ource)
              javax.smartcardio.CardNotPresentException: No card present
                      at sun.security.smartcardio.TerminalImpl.connect(Unknown Source)
                      at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(Unknown S
              ource)
              Caused by: sun.security.smartcardio.PCSCException: SCARD_W_REMOVED_CARD
                      at sun.security.smartcardio.PCSC.SCardConnect(Native Method)
                      at sun.security.smartcardio.CardImpl.<init>(Unknown Source)
                      ... 2 more
              Found card in terminal: ACS ACR1281 1S Dual Reader PICC 0
              java.lang.NullPointerException
                      at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(Unknown S
              ource)
              javax.smartcardio.CardNotPresentException: No card present
                      at sun.security.smartcardio.TerminalImpl.connect(Unknown Source)
                      at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(Unknown S
              ource)
              Caused by: sun.security.smartcardio.PCSCException: SCARD_W_REMOVED_CARD
                      at sun.security.smartcardio.PCSC.SCardConnect(Native Method)
                      at sun.security.smartcardio.CardImpl.<init>(Unknown Source)
                      ... 2 more
              Found card in terminal: ACS ACR1281 1S Dual Reader SAM 0
              java.lang.NullPointerException
                      at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(Unknown S
              ource)
              What can I do to fix this? Did I missed any steps? Thanks for any reply.
              • 4. Re: I cannot load my java card applet Response APDU: 69 85
                999919
                What you have done seems to be fine. However the status 0x6A80 means the command carries wrong data.
                CLA=80
                INS=E8
                P1=00 More data and hence more load commands will follow
                P2=00 This is the first (0 th) block
                Lc = FF There are 255 bytes in the data section of the command
                The next byte 'C4' is the tag identifier that indicates the start of the data block.

                All of the above is correct with regards to the structure of the LOAD command
                So the culprit could be your CAP file.
                What is the version of the java-card-kit you are using?
                • 5. Re: I cannot load my java card applet Response APDU: 69 85
                  975608
                  Java Card 3.0 classic edition and I compile it with java 1.7.
                  • 6. Re: I cannot load my java card applet Response APDU: 69 85
                    999919
                    Are you sure, that your card also supports Java card 3.0?