com
Class SIMProxy

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.SIMProxy
All Implemented Interfaces:
java.lang.Runnable

public class SIMProxy
extends java.lang.Thread

Defines the Card Application Identifier (AID) GSM AID: apdu:0;target=A0.00.00.00.03.00.00 ?? UMTS AID: apdu:0;target=A0.00.00.00.87.10.02.FF.34.FF.07.89.31.2E.30.FF ?? 0xa0:0x0:0x0:0x0:0x62 is the fixed part and is always similar The AID of the installer applet is 0xa0:0x00:0x00:0x00:0x62:0x03:0x01:0x08:0x01 The AID of the applet is: 0xa:0x0:0x0:0x0:0x62:0x3:0x1:0x1 Format: :;target= (for apdu it is: apdu:;target= ) Because a handset may support more that one smart card, SATSA defines a special property to discover the available smart card slots. This property, called microedition.smartcardslots, can be queried by calling the method System.getProperty() which returns a comma-delimited list of available slots Java card supports two smart cards according: 0H,1H (0 and 1 with Hotswap functionality..)

Since:
March 20, 2007
Author:
Håvard Holje

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SIMProxy(SIMSupplicant simSupplicant, byte[] apdu, int type)
          Constructor 2
SIMProxy(SIMSupplicant simSupplicant, int type)
          Constructor 1
 
Method Summary
 java.lang.String byteArrayHexToString(byte[] response)
          Helper method that interprets the APDU response from SIM Converts HEX values from the byte Array to a String.
 java.lang.String bytesToHex(byte[] data)
          Convenience method to convert a byte array to a hex string.
 java.lang.String byteToHex(byte data)
          Convenience method to convert a byte to a hex string.
 void connect()
          Setting up connection to the SIM
 void run()
          All I/O handling is executing in a Thread
 void setFinish()
          Sets the finish flag to close the APDU Connection
 void setGetImsiCmd(byte[] CMD_GET_IMSI)
          Sets the CMD_GET_IMSI Command APDU and reset the old ones
 void setRunGsmAlgCmd(byte[] CMD_GET_IMSI)
          Sets the CMD_RUN_GSM_ALG Command APDU and reset the old ones
 void setType(int type)
           
 void setVerifyPinCmd(byte[] CMD_VERIFY_CHV)
          Sets the CMD_VERIFY_CHV Command APDU
 char toHexChar(int i)
          Convenience method to convert an int to a hex char.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SIMProxy

public SIMProxy(SIMSupplicant simSupplicant,
                int type)
Constructor 1

Parameters:
simSupplicant -
type -

SIMProxy

public SIMProxy(SIMSupplicant simSupplicant,
                byte[] apdu,
                int type)
Constructor 2

Parameters:
apdu -
Method Detail

setType

public void setType(int type)
Parameters:
type -

setVerifyPinCmd

public void setVerifyPinCmd(byte[] CMD_VERIFY_CHV)
Sets the CMD_VERIFY_CHV Command APDU

Parameters:
CMD_VERIFY_CHV -

setFinish

public void setFinish()
Sets the finish flag to close the APDU Connection


setGetImsiCmd

public void setGetImsiCmd(byte[] CMD_GET_IMSI)
Sets the CMD_GET_IMSI Command APDU and reset the old ones

Parameters:
CMD_GET_IMSI -

setRunGsmAlgCmd

public void setRunGsmAlgCmd(byte[] CMD_GET_IMSI)
Sets the CMD_RUN_GSM_ALG Command APDU and reset the old ones

Parameters:
CMD_GET_IMSI -

run

public void run()
All I/O handling is executing in a Thread


connect

public void connect()
Setting up connection to the SIM


byteArrayHexToString

public java.lang.String byteArrayHexToString(byte[] response)
Helper method that interprets the APDU response from SIM Converts HEX values from the byte Array to a String.

Parameters:
response -
Returns:
String

bytesToHex

public java.lang.String bytesToHex(byte[] data)
Convenience method to convert a byte array to a hex string.

Parameters:
data - the byte[] to convert
Returns:
String the converted byte[]

byteToHex

public java.lang.String byteToHex(byte data)
Convenience method to convert a byte to a hex string.

Parameters:
data - the byte to convert
Returns:
String the converted byte

toHexChar

public char toHexChar(int i)
Convenience method to convert an int to a hex char.

Parameters:
i - the int to convert
Returns:
char the converted char