Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading IMSI in the GSM CARD.

843851Nov 23 2006
Sorry All ... but I stard a new topic on one of my old subject.

Hi everybody ... Acutally I try to read the IMSI (serial number of a gsm sim card), I've moved to the JAVA 1.6 release, because AFAIK, the is the only version that support smartcard I/O.

Actually I use this code to access my card:


------------- CUT HERE -------------------
try {
         List<CardTerminal> terminals = factory.terminals().list();
         System.out.println("Terminals: " + terminals);
    // Get the first terminal
         CardTerminal terminal = terminals.get(0);
    // * *******************************************************************************
    // *
    // * Establish a connection with the card
         Card card = terminal.connect("T=0");
         System.out.println("card: " + card);
         byte[] x = { (byte)0x00,(byte)0x00,(byte)0x00,(byte)0xc1 };
         
         byte Command[]; 
         Command=new byte[4];

         Command[0]=(byte)0xCA;
         Command[1]=(byte)0xA0; // calculator
         Command[2]=(byte)0x03;
         Command[3]=(byte)0x03; 
         
         
         CardChannel channel = card.getBasicChannel();
         ResponseAPDU r = channel.transmit(new CommandAPDU(Command));
----------- CUT HERE ----------------------

I think that I've to know the right value for the Command byte.
Any suggestion?!?!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 21 2006
Added on Nov 23 2006
0 comments
371 views