|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.device.IccManager
public class IccManager
The IccManager class is used to initialize and control the smart card reader, to sends a command Application Protocol Data Unit(APDU) to a card and retrieve the response APDU.
To control the smart card reader with this class, use the following steps:
open(byte, byte, byte)
.
detect()
.
activate(byte[] )
.
apduTransmit(byte[], int, byte[], byte[])
.
deactivate()
.
close()
to close the slot for smart card reader.
For more information about the smart card reader, read the samples folder below IccManager , ISO4442 Demo and PASMDemo .
Constructor Summary | |
---|---|
IccManager()
|
Method Summary | |
---|---|
int |
activate(byte[] pAtr)
Activate and reset the card |
int |
apduTransmit(byte[] apdu,
int apduLen,
byte[] rsp,
byte[] sw)
Transmit APDU to the IC card |
byte[] |
at88sc102_read(int addr,
int length)
Read the data stored in main memory for At88sc102 |
int |
at88sc102_VerifyPassword(int type,
byte[] data,
int length)
Check & Verify password for At88sc102. |
int |
at88sc102_write(int addr,
byte[] data,
int dataLen)
Write data to the main storage area At88sc102 |
int |
close()
Close the slot |
int |
deactivate()
Deactivate the card |
int |
detect()
check if IC card is inserted |
int |
getResponseEnable(byte autoFlag)
Set whether the drive layer to the 61xx, 6Cxx and other commands for automatic data acquisition, the default for automatic acquisition. |
int |
open(byte slot,
byte CardType,
byte Volt)
Open the IC card for operation |
int |
setETU(int etuTime)
Set the ETU. |
int |
sle4428_password(int mode,
byte[] data)
Submit the transfer data, enter the personalization mode |
byte[] |
sle4428_readMemory(int addr,
int length)
Read the data stored in main memory for SLE4428 |
int |
sle4428_reset(byte[] pAtr)
reset the SLE4428 |
int |
sle4428_writeMemory(int addr,
byte[] data,
int dataLen)
Write data to the main storage area SLE4428 |
byte[] |
sle4436_authenticate(int key,
byte[] clkCnt,
byte[] challengeData)
Get the Card verification certificate |
int |
sle4436_decValue(int pValue)
Reduction balance |
int |
sle4436_readBit(byte[] pData)
Read values from the Card bit |
byte[] |
sle4436_readMemory(int addr,
int length)
Read the data stored in main memory for SLE4436 |
int |
sle4436_regIncrease(int shiftBits)
Move the register |
int |
sle4436_reloadByte()
Reload Byte |
int |
sle4436_reset(byte[] pAtr)
reset the SLE4436 |
int |
sle4436_verifyPassword(byte[] passwd)
Submit the transfer data, enter the personalization mode |
int |
sle4436_writeBit()
Write a byte for Card |
int |
sle4436_writeCarry(int mode,
int addr,
byte[] data,
int dataLen)
Write Carry data |
int |
sle4436_writeMemory(int addr,
byte[] data,
int dataLen)
Write data to the main storage area SLE4436 |
int |
sle4442_changePassword(byte[] passwd)
Change password. |
int |
sle4442_readErrorCounter(byte[] errorCount)
Change password. |
byte[] |
sle4442_readMainMemory(int addr,
int length)
Read the data stored in main memory for SLE4442 |
byte[] |
sle4442_readProtectionMemory(int address,
int len)
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 |
sle4442_reset(byte[] pAtr)
reset the SLE4442 |
int |
sle4442_verifyPassword(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 |
sle4442_writeMainMemory(int addr,
byte[] data,
int dataLen)
Write data to the main storage area SLE4442 |
int |
sle4442_writeProtectionMemory(int addr,
byte[] data,
int dataLen)
The write protection bit storage area. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IccManager()
Method Detail |
---|
public int open(byte slot, byte CardType, byte Volt)
slot
- 0 - IC slot; 1 - PSAM slotCardType
- type: 0x01 - IC card;
0x02 - SLE4442;Volt
- valtage to supply:
0x01 - 3V;
0x02 - 5V;
0x03 - 1.8V;
public int close()
public int detect()
public int activate(byte[] pAtr)
pAtr
- to store the returned ATR from the card
public int apduTransmit(byte[] apdu, int apduLen, byte[] rsp, byte[] sw)
apdu
- APDU to be sent to the cardapduLenLength
- of APDUrsp
- to store the response from the cardsw
- to store the returned status bytes
public int deactivate()
public int getResponseEnable(byte autoFlag)
autoFlag
- value 0: by the application layer to get; 1: by the drive layer is automatically acquired.
public int setETU(int etuTime)
etuTime
- ETU
public int sle4442_reset(byte[] pAtr)
pAtr
- to store the return ATR
public byte[] sle4442_readMainMemory(int addr, int length)
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.
public int sle4442_writeMainMemory(int addr, byte[] data, int dataLen)
addr
- The starting address of operation data, the range of the parameters of the SLE4442 card: 0---255.data
- The data to be written
public byte[] sle4442_readProtectionMemory(int address, int len)
address
- 0x00- 0xffLen
- Length to read, 4 Bytes:
bit31 - read out 32Bytes;
bit0 - read out 1Byte;
bit* - etc.
public int sle4442_writeProtectionMemory(int addr, byte[] data, int dataLen)
addr
- The starting address of operation data, the range of the parameters of the SLE4442 card: 0---31.data
- Write protect bit data
public int sle4442_verifyPassword(byte[] passwd)
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
public int sle4442_changePassword(byte[] passwd)
passwd
- The data buffer point to the new password.
public int sle4442_readErrorCounter(byte[] errorCount)
errorCount
- The data buffer point to error count, 1Byte.
public int sle4436_reset(byte[] pAtr)
pAtr
- to store the return ATR
public byte[] sle4436_readMemory(int addr, int length)
addr
- The starting address of operation data, the range of the parameters of the SLE4436 card: 0---112.length
- To read the data length, the range of the parameters of the SLE4436 card: 1---112.
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.
public int sle4436_writeMemory(int addr, byte[] data, int dataLen)
addr
- The starting address of operation data, the range of the parameters of the SLE4436 card: 0---112.data
- The data to be writtendataLen
- The data length
public int sle4436_writeCarry(int mode, int addr, byte[] data, int dataLen)
mode
- addr
- The starting address of operation datadata
- The data to be writtendataLen
-
public int sle4436_verifyPassword(byte[] passwd)
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
public byte[] sle4436_authenticate(int key, byte[] clkCnt, byte[] challengeData)
key
- clkCnt
- Number of clockchallengeData
-
public int sle4436_regIncrease(int shiftBits)
shiftBits
- move Bits
public int sle4436_readBit(byte[] pData)
shiftBits
-
public int sle4436_writeBit()
public int sle4436_reloadByte()
public int sle4436_decValue(int pValue)
pValue
- The Amount of money to be eduction
public int sle4428_reset(byte[] pAtr)
pAtr
- to store the return ATR
public byte[] sle4428_readMemory(int addr, int length)
addr
- The starting address of operation data, the range of the parameters of the SLE4428 card: 0---0x3FF.length
- To read the data length, the range of the parameters of the SLE4428 card: 1---0x400.
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.
public int sle4428_writeMemory(int addr, byte[] data, int dataLen)
addr
- The starting address of operation data, the range of the parameters of the SLE4428 card: 0---0x3FF.data
- The data to be writtendataLen
- The data length, 0x400.
public int sle4428_password(int mode, byte[] data)
mode
- 0 verify password or 1 changed passworddata
- 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
public byte[] at88sc102_read(int addr, int length)
addr
- The starting address of operation data, the range of the parameters of the At88sc102 card: 0---0xFF.length
- To read the data length, the range of the parameters of the At88sc102 card: 1---0x100.
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.
public int at88sc102_write(int addr, byte[] data, int dataLen)
addr
- The starting address of operation data, the range of the parameters of the At88sc102 card: 0---0xFF.data
- The data to be writtendataLen
- The data length, 0x100.
public int at88sc102_VerifyPassword(int type, byte[] data, int length)
type,
- type of password. 0: SC, 1: erase EZ1 password, 2: erase EZ2 password.data,
- password to verify. If type is SC, the len should be 2Bytes. EZ1, the len should be 6Bytes. EZ2, the len should be 4Bytes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |