|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.javacard.apduio.CadDevice
com.sun.javacard.apduio.CadT1
public class CadT1
The CadT1 class manages the encodes and decodes T=1 transport level messages between an InputStream and an OutputStream. This class wraps T=1 commands in a reader layer. basically, in order to send commands to the reader, a wrapper protocol has been defined. The wrapper protocol wraps message as follows: +---------+--------+---------------+-----+ | OPCODE | LENGTH | ...MESSAGE... | LRC | +---------+--------+---------------+-----+ 1 byte 2 bytes n bytes 1 byte See T1Block class for further reference.
Field Summary | |
---|---|
protected static int |
MAX_IFS_SIZE
|
Fields inherited from class com.sun.javacard.apduio.CadDevice |
---|
_messages, debug, deviceProtocol, in, out, PROTOCOL_PCSC, PROTOCOL_T0, PROTOCOL_T1, PROTOCOL_TCL |
Constructor Summary | |
---|---|
CadT1(java.io.InputStream in,
java.io.OutputStream out)
Create a new instance of the CadT1 class using an InputStream and an OutputStream. |
Method Summary | |
---|---|
boolean |
exchangeBlock(T1Block blockTo,
T1Block blockFrom)
Implement T=1 I-block, R-block and S-block primitives Exchanges a block between the terminal and the Card reader. |
int |
getMaxIFSSize()
Returns the maximum IFS size supported by this CAD T=1 instance. |
boolean |
receiveBlock(T1Block blockFrom)
Reads the first T=1 Block from the terminal, setting the information inteh block passed as parameter. |
boolean |
receivePowerUp()
Receives the power-up command from the terminal. |
byte[] |
retrieveATR()
Receives the Aswer-To-Reset bytes from the card. |
boolean |
sendATR(byte[] atrData)
Sends the Aswer-To-Reset bytes to the terminal. |
void |
sendPowerDown()
Sends the power-down command to the card. |
void |
sendPowerUp()
Sends the power-up command to the card. |
Methods inherited from class com.sun.javacard.apduio.CadDevice |
---|
close, getCadClientInstance, getDeviceProtocol, getPCSCClientInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int MAX_IFS_SIZE
Constructor Detail |
---|
public CadT1(java.io.InputStream in, java.io.OutputStream out)
in
- The InputStream to read from.out
- The OutputStream to write to.Method Detail |
---|
public boolean exchangeBlock(T1Block blockTo, T1Block blockFrom) throws java.io.IOException, T1Exception
blockTo
- T1Block instance representing the block to send to the other
entity.blockFrom
- T1Block instance representing the block received from the
other entity.
T1Exception
- if a T=1 protocol or transport protocol inconsistency is
detected
java.io.IOException
- if a problem with the I/O exchange mechanism occurs.public boolean receiveBlock(T1Block blockFrom) throws java.io.IOException, T1Exception
blockFrom
- Block in which to receive the data.
T1Exception
- if a transport protocol inconsistency is detected.
java.io.IOException
- if a problem with the I/O exchange mechanism.public boolean sendATR(byte[] atrData) throws java.io.IOException, T1Exception
atrData
- Byte array containing the ATR string.
T1Exception
- if a transport protocol inconsistency is detected
java.io.IOException
- if a problem with the I/O exchange mechanism occurs.public int getMaxIFSSize()
public byte[] retrieveATR() throws java.io.IOException, T1Exception
T1Exception
- if a transport protocol inconsistency is detected
java.io.IOException
- if a problem with the I/O exchange mechanism occurs.public boolean receivePowerUp() throws java.io.IOException, T1Exception
T1Exception
- if a transport protocol inconsistency is detected
java.io.IOException
- if a problem with the I/O exchange mechanism occurs.public void sendPowerUp() throws java.io.IOException, T1Exception
T1Exception
- if a transport protocol inconsistency is detected
java.io.IOException
- if a problem with the I/O exchange mechanism occurs.public void sendPowerDown() throws java.io.IOException, T1Exception
T1Exception
- if a transport protocol inconsistency is detected
java.io.IOException
- if a problem with the I/O exchange mechanism occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |