android.device
Class IccManager

java.lang.Object
  extended by android.device.IccManager

public class IccManager
extends java.lang.Object

The android.device.IccManager class provides support for IC card reader and SAM card reader


Constructor Summary
IccManager()
           
 
Method Summary
 byte[] IccAct(char volt)
          Activate the selected slot.
 boolean IccClose()
          Close the card reader
 byte[] IccExapdu(byte[] apdu_utf, char apdu_count)
          Sends APDU commands
 byte[] IccFound()
          Search card reader slots for care present
 boolean IccOpen()
          Open the card reader
 int IccSelect(char slot)
          Select the operating card reader
 byte[] Sle4442Act(char volt, byte[] atr_len)
          Activate IC4442 from the selected slot.
 byte[] SleReadmainmem(char addr, char length)
          Read and store the data in SLE4442
 byte[] SleReadprotecmem()
          Read SLE4442 card protection bit storage data (4 BYTE). 4 bytes of data read is to save the SLE4442 bits data in storage area.
 int SleVerify(byte[] passwd)
          Comparison of SLE4442 cards, each card after power compared to the card password, otherwise the card data is read-only, you will not be on the card of any write operation.
 int SleWritemainmem(char addr, char data)
          Write data to the main storage area SLE4442
 int SleWriteProtecmem(char addr, char data)
          The write protect bit storage area.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IccManager

public IccManager()
Method Detail

IccOpen

public boolean IccOpen()
Open the card reader

Returns:
Returns true if successful, returns false if failed.

IccClose

public boolean IccClose()
Close the card reader

Returns:
Returns true if successful, returns false if failed.

IccFound

public byte[] IccFound()
Search card reader slots for care present

Returns:
Returns array of byte. Each represents a card reader. Value of 1 means card is present and value of 0 means not present.

IccSelect

public int IccSelect(char slot)
Select the operating card reader

Parameters:
slot - Position to be used (typically a position with card present as checked by IccFound).
Returns:
Returns 0 if successful. Returns -1 if failed.

IccAct

public byte[] IccAct(char volt)
Activate the selected slot.

Parameters:
volt - The operating voltage. Could be 5V, 3V etc
Returns:
Returns byte array indicating the ATR if successful. Returns null if failed.

IccExapdu

public byte[] IccExapdu(byte[] apdu_utf,
                        char apdu_count)
Sends APDU commands

Parameters:
apdu_utf - The apdu command to send
apdu_count - The apdu command length
Returns:
Returns the apdu response if succesful. Returns null if failed.

Sle4442Act

public byte[] Sle4442Act(char volt,
                         byte[] atr_len)
Activate IC4442 from the selected slot.

Parameters:
volt - The operating voltage. Could be 5V, 3V etc
atr_len - for the byte array indicating the ATR length.
Returns:
Returns byte array indicating the ATR if successful. Returns null if failed.

SleReadmainmem

public byte[] SleReadmainmem(char addr,
                             char length)
Read and store the data in SLE4442

Parameters:
addr - The starting address of operation data, the range of the parameters of the SLE4442 card: 0---255.
length - To read the data length, the range of the parameters of the SLE4442 card: 1---256. In addition to ByteAddr and Length and cannot be greater than the actual capacity of the card, otherwise the reader will refuse to execute the command, and returns an error.
Returns:
Returns byte array indicating the store data if successful. Returns null if failed.

SleWritemainmem

public int SleWritemainmem(char addr,
                           char data)
Write data to the main storage area SLE4442

Parameters:
addr - The starting address of operation data, the range of the parameters of the SLE4442 card: 0---255.
data - The data to be written
Returns:
Returns 0 if successful. Returns -1 if failed.

SleReadprotecmem

public byte[] SleReadprotecmem()
Read SLE4442 card protection bit storage data (4 BYTE). 4 bytes of data read is to save the SLE4442 bits data in storage area. Sequential data bit: low in front, high in the post. Such as: read data: 30 FF 1F F8 from the first byte of 30H can be analyzed as follows: the binary 30H corresponding to the lower four bits: 00110000 to 0 represent the four byte SLE4442 of the card (answer to reset) cannot be changed

Returns:
Returns byte array indicating protected storage data if successful. Returns null if failed.

SleWriteProtecmem

public int SleWriteProtecmem(char addr,
                             char data)
The write protect bit storage area. Write protection on the 4442 card data (disposable, write protection will not be able to restore). Before the 32BYTE data only for SLE4442 write protect (corresponding to protect a storage area of 32 BIT). This function can be one of a plurality of consecutive bytes protection (up to 32 bytes). According to the write protection properties of SLE4442 card, to a byte write protection must provide the bytes of data at the same time sends the write protection command, consistent data only provides the data and the actual store when really on the specified storage area is write protected.

Parameters:
addr - The starting address of operation data, the range of the parameters of the SLE4442 card: 0---31.
data - Write protect bit data
Returns:
Returns 0 if successful. Returns -1 if failed.

SleVerify

public int SleVerify(byte[] passwd)
Comparison of SLE4442 cards, each card after power compared to the card password, otherwise the card data is read-only, you will not be on the card of any write operation. Secure storage area (except the error counter outside) will not be able to read and write

Parameters:
passwd - The data buffer pointer password, password here to store data migration and card in the password. The first byte of pt corresponding to protected storage (pt+1) corresponding to second byte protected storage (pt+2) corresponding to third byte protected storage
Returns:
Returns 0 if successful. Returns -1 if failed.