core
Class SIMSupplicant

java.lang.Object
  extended bycore.SIMSupplicant

public class SIMSupplicant
extends java.lang.Object

This class handles all SIM communication. It initializes a new thread that creates the APDU connection to the SIM

Since:
4. May 2007
Author:
Håvard Holje

Constructor Summary
SIMSupplicant(Controller controller)
          Constructor
SIMSupplicant(Controller controller, java.lang.String pin)
          Constructor
 
Method Summary
 void finish()
           
 void getIMSI()
          Calls the request handler with type=2 (GET_IMSI)
 void getSRES()
          Calls the request handler with type=3 (RUN_GSM_ALGORITHM)
 void handleSIMRequest_old(int type)
          This method handles the SIM request and creates proper Command APDU
 void handleSIMRequest(int type)
          This method handles the SIM request and creates proper Command APDU
 void handleSIMResponse(int type, java.lang.String response)
          Handles the response from SIM.
 void setPin(java.lang.String pin)
           
 byte[] strToByteArray(java.lang.String pin)
          Converting the input String to a byte array
 void validatePin(java.lang.String pin)
          Calls the request handler with type=1 (PIN)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SIMSupplicant

public SIMSupplicant(Controller controller,
                     java.lang.String pin)
Constructor

Parameters:
controller -
pin -

SIMSupplicant

public SIMSupplicant(Controller controller)
Constructor

Parameters:
controller -
Method Detail

setPin

public void setPin(java.lang.String pin)
Parameters:
pin -

validatePin

public void validatePin(java.lang.String pin)
Calls the request handler with type=1 (PIN)


getIMSI

public void getIMSI()
Calls the request handler with type=2 (GET_IMSI)


getSRES

public void getSRES()
Calls the request handler with type=3 (RUN_GSM_ALGORITHM)


finish

public void finish()

handleSIMRequest

public void handleSIMRequest(int type)
This method handles the SIM request and creates proper Command APDU

Parameters:
type -

handleSIMRequest_old

public void handleSIMRequest_old(int type)
This method handles the SIM request and creates proper Command APDU

Parameters:
type -

handleSIMResponse

public void handleSIMResponse(int type,
                              java.lang.String response)
Handles the response from SIM. Parses the input and calls the appropriate handler in the Controller.

Parameters:
type -

strToByteArray

public byte[] strToByteArray(java.lang.String pin)
Converting the input String to a byte array

Parameters:
pin -
Returns:
pin