Ady Wicaksono Daily Activities

Installing JavaCard Applet into real SmartCard

with 4 comments

A few days ago I got email from someone from US. He asked me how to load his javacard application into T-Mobile SIMCard and he inform me that this smartcard is produced by Gemalto. I informed him this graphics:
install java app into smartcard

See, to install javacard applet we need to:

1. Select appropriate Issuer Security Domain
2. Do optinal authentication
3. Run install for load
4. Load the javacard applet into javacard
5. Run install for install

For example, please take a look on this

SELECT
  00 A4 04 00 0F A0 00 00 00 18 43 4D FF 33 FF FF 89 00 00 00
  61 22   [Normal ending of the command with  bytes of extra information.]
INITIALIZE UPDATE
  80 50 01 01 08 00 01 02 03 04 05 06 07 (1C)
  00 00 07 FF 01 06 01 02 68 65 01 01 85 C6 B5 1E 2F 27 98 13 9F E4 21 63 10 D9 59 B6, 90 00   [Normal ending of the command.]
EXTERNAL AUTHENTICATE
  84 82 01 00 10 3E 46 1F 3C EF B0 A6 EC 22 23 21 9F 65 8F 12 61
  90 00   [Normal ending of the command.]
INSTALL FOR LOAD
  84 E6 02 00 2B 10 A0 00 00 00 18 50 00 00 00 00 00 00 52 41 44 50 00 00 0E EF 0C C6 02 00 00 C8 02 00 00 C7 02 00 00 00 2A 8B 3A 01 3C 8E FD A4 (00)
  00, 90 00   [Normal ending of the command.]
LOAD
  84 E8 00 00 CB C4 82 26 90 01 00 1A DE CA FF ED 01 02 04 00 02 10 A0 00 00 00 18 50 00 00 00 00 00 00 52 41 44 50 02 00 1F 00 1A 00 1F 00 14 00 45 01 E2 00 25 1B 76 00 0A 03 8B 00 00 04 CE 00 03 00 00 00 00 05 01 00 04 00 45 05 00 01 07 A0 00 00 00 62 01 01 06 02 10 A0 00 00 00 09 00 03 FF FF FF FF 89 10 71 00 02 02 02 10 A0 00 00 00 09 00 03 FF FF FF FF 89 10 71 00 01 01 01 07 A0 00 00 00 62 02 01 00 01 07 A0 00 00 00 62 00 01 03 00 14 01 10 A0 00 00 00 18 50 00 00 00 00 00 00 52 41 44 41 08 BB 06 00 25 43 80 03 3F 00 2B 07 02 00 00 09 30 08 D1 80 02 00 81 01 01 08 81 00 00 01 84 00 00 FF 00 79 7F 6C F3 70 1C E3 05 (00)
  90 00   [Normal ending of the command.]
LOAD
  84 E8 00 01 CB 01 00 00 00 81 00 00 07 1B 76 00 09 10 18 8C 00 3C 18 10 0A 89 00 18 10 14 89 01 18 10 11 89 02 18 10 3C 89 03 18 10 0B 90 0B 3D 03 10 52 38 3D 04 10 65 38 3D 05 10 63 38 3D 06 10 68 38 3D 07 10 61 38 3D 08 10 72 38 3D 10 06 10 67 38 3D 10 07 10 65 38 3D 10 08 10 20 38 3D 10 09 10 42 38 3D 10 0A 10 79 38 87 04 18 10 09 90 0B 3D 03 10 54 38 3D 04 10 65 38 3D 05 10 6C 38 3D 06 10 65 38 3D 07 10 70 38 3D 08 10 68 38 3D 10 06 10 6F 38 3D 10 07 10 6E 38 3D 10 08 10 65 38 87 05 18 10 07 90 0B 3D 03 10 41 38 3D 04 10 63 38 3D 05 10 63 38 3D 06 10 6F 38 3D 07 10 75 38 3D 08 10 6E 38 3D B0 25 51 D9 50 5F 87 E8 (00)
  90 00   [Normal ending of the command.]
LOAD
  84 E8 00 02 CB 10 06 10 74 38 87 06 18 10 06 90 0B 3D 03 10 41 38 3D 04 10 6D 38 3D 05 10 6F 38 3D 06 10 75 38 3D 07 10 6E 38 3D 08 10 74 38 87 07 18 10 08 90 0B 3D 03 10 50 38 3D 04 10 61 38 3D 05 10 73 38 3D 06 10 73 38 3D 07 10 77 38 3D 08 10 6F 38 3D 10 06 10 72 38 3D 10 07 10 64 38 87 08 18 10 07 90 0B 3D 03 10 45 38 3D 04 10 57 38 3D 05 10 61 38 3D 06 10 6C 38 3D 07 10 6C 38 3D 08 10 65 38 3D 10 06 10 74 38 87 09 18 10 0D 90 0B 3D 03 10 53 38 3D 04 10 65 38 3D 05 10 6E 38 3D 06 10 64 38 3D 07 10 20 38 3D 08 10 4D 38 3D 10 06 10 6F 38 3D 10 07 10 6E 38 3D 10 08 10 65 38 3D 10 09 10 79 38 9E 34 41 40 17 58 16 B2 (00)
  90 00   [Normal ending of the command.]
LOAD
  84 E8 00 31 CB 00 F6 00 F4 00 F4 00 F4 00 F8 00 FC 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F4 00 F6 00 F6 00 F6 00 F6 00 F6 00 F6 00 F6 00 F6 01 00 01 02 00 FC 01 07 FF FF 01 00 01 09 01 0C 00 F6 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 10 01 12 01 16 01 1A 01 1E 01 23 00 F2 01 27 01 29 01 2D 01 2F 00 F6 01 33 01 36 01 2F 00 F8 00 F2 01 3B 01 3E 00 F6 01 42 01 45 01 49 FF FF 01 51 01 53 01 56 01 5A 01 60 01 65 01 00 01 45 01 68 01 6A 01 6A 01 6C 01 6C 01 53 01 6C 01 6F 01 72 00 F6 00 F6 00 F6 01 40 01 B0 01 30 05 68 20 00 05 68 10 3A DA 06 19 0B 4B FA AF (00)
  90 00   [Normal ending of the command.]
LOAD
  84 E8 80 32 86 90 01 10 08 B4 43 23 43 02 31 04 B4 31 05 68 10 80 01 20 05 68 10 A0 05 68 10 50 05 B4 43 40 07 33 4B 44 40 06 B4 B4 43 02 43 05 4B 44 40 02 34 06 33 B4 41 04 33 31 08 33 B4 44 41 03 B4 40 05 3B 44 10 03 43 B0 06 B4 B4 44 0D 68 10 A6 81 05 B4 30 02 B1 03 BB 10 06 68 10 A1 09 68 10 AB 43 30 08 BB 33 B3 31 04 B4 41 02 41 02 32 03 B3 10 04 BB 31 03 33 30 06 68 00 A1 05 68 30 10 5B 8E B3 C4 EB 52 1A B6 (00)
  00, 90 00   [Normal ending of the command.]
INSTALL FOR INSTALL Make Selectable
  84 E6 0C 00 64 10 A0 00 00 00 18 50 00 00 00 00 00 00 52 41 44 50 10 A0 00 00 00 18 50 00 00 00 00 00 00 52 41 44 41 10 A0 00 00 00 18 50 00 00 00 00 00 00 52 41 44 41 01 00 25 EF 21 C7 02 00 00 C8 02 00 00 CA 17 01 00 FF 00 14 07 01 01 02 02 03 03 04 04 05 05 06 06 07 07 00 00 00 C9 00 00 24 40 FD BA F2 A0 12 7F (00)
  00, 90 00   [Normal ending of the command.]

This scenario is based on GlobalPlatform Specification. And here’s a sample result on my Nokia 3660:

1. Choose menu SIMCard
hasiljavacard1

2. Choose GemXplore Case
hasiljavacard2

3. Example STK Menu of Javacard application
hasiljavacard3

About these ads

Written by adywicaksono

January 5, 2008 at 12:50 pm

Posted in SmartCard

4 Responses

Subscribe to comments with RSS.

  1. Dear Ady Wicaksono,
    Your blog is interested, cause your field is the same as me in smartcard & javacard technology. Hope we can discuss about this interested field.

    Regards,
    Youzt

    please visit my simple blog that never updated anymore at:
    http://youzt.wordpress.com/2007/05/
    http://java-relax.blogspot.com/

    Youzt

    January 25, 2008 at 5:36 pm

  2. Thanks for your useful guide article.
    That was what solved my problem,
    I hope your success…

    Amir

    July 28, 2009 at 8:37 am

    • I would require help on smart card programming, As very few resource is available, I would like to learn about the procedure to install an applet on javacard.
      my email is chetan_saini@yahoo.com and no is 9871691797.
      please give me ur number or sms

      chetan

      April 11, 2011 at 2:24 pm

  3. Hi Ady,

    I am trying to deploy my Java Card Applet using Gemalto Developer suite. The applet works in Mobile Simulator 3G but while trying to install in card, it fails. It fails at “Install for Load”. After inspecting the APDU command with what you have pasted, I see mine is different. APDU syntax is bit of Chinese to me, so am pasting it here. Can you tell me where it went wrong?

    Install For Load
     84 E6 02 00 2B 10 A0 00 00 00 18 50 00 00 00 00 00 00 52 41 44 50 00 00 0E EF 0C C6 02 00 00 C8 02 00 00 C7 02 00 00 00 23 B0 6C EF 04 7F F7 B3 (00)
    [ERROR ] <- 6D 00
    [ERROR ] <- Invalid instruction.

    Please let me know if you need more information to get a better idea about my problem.

    Thanks in advance,
    Naidu

    Naidu

    December 18, 2009 at 4:45 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: