opencard.opt.terminal.protocol
Class T1Block
java.lang.Object
|
+--opencard.opt.terminal.protocol.T1Block
- public class T1Block
- extends java.lang.Object
T1Block
represents T1 block (see ISO7816-3)
- Version:
- $Id: T1Block.java,v 1.2 1999/10/20 13:15:00 damke Exp $
|
Constructor Summary |
T1Block(byte[] rawBytes,
int edcInfo)
create Block object from raw T1-Block |
T1Block(int src,
int dest,
int pcb,
byte[] dat,
int edcInfo)
Constructor |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
EDC_LDR
public static final int EDC_LDR
- use LDR (XOR) algorithm for EDC byte
EDC_CRC
public static final int EDC_CRC
- use CRC16 algorithm for EDC byte - not implemented
ERROR_NONE
public static final int ERROR_NONE
- indicates error free operation
ERROR_EDC
public static final int ERROR_EDC
- indicates EDC error
ERROR_OTHER
public static final int ERROR_OTHER
- indicates other error
S_RESYNCH_REQUEST
public static final int S_RESYNCH_REQUEST
- S_RESYNCH_REQUEST
S_RESYNCH_RESPONSE
public static final int S_RESYNCH_RESPONSE
- S_RESYNCH_RESPONSE
S_IFS_REQUEST
public static final int S_IFS_REQUEST
- S_IFS_REQUEST
S_IFS_RESPONSE
public static final int S_IFS_RESPONSE
- S_IFS_RESPONSE
S_ABORT_REQUEST
public static final int S_ABORT_REQUEST
- S_ABORT_REQUEST
S_ABORT_RESPONSE
public static final int S_ABORT_RESPONSE
- S_ABORT_RESPONSE
S_WTX_REQUEST
public static final int S_WTX_REQUEST
- S_WTX_REQUEST
S_WTX_RESPONSE
public static final int S_WTX_RESPONSE
- S_WTX_RESPONSE
S_VPP_STATE_ERROR_RESPONSE
public static final int S_VPP_STATE_ERROR_RESPONSE
- S_VPP_STATE_ERR_RESPONSE
I_BLOCK
public static final int I_BLOCK
- I-block
R_BLOCK
public static final int R_BLOCK
- R-block
S_BLOCK
public static final int S_BLOCK
- S-block
T1Block
public T1Block(int src,
int dest,
int pcb,
byte[] dat,
int edcInfo)
throws T1BlockLengthException,
T1BlockEDCErrorException
- Constructor
- Parameters:
src - source-address for T1 blockdest - destination-address for T1-Blockpcb - protocol control bytedat - info data within T1 block
set to null for no data availableedcInfo - EDC_LDR (XOR) or EDC_CRC
T1Block
public T1Block(byte[] rawBytes,
int edcInfo)
throws T1BlockLengthException,
T1BlockEDCErrorException
- create Block object from raw T1-Block
calcEDC
public int calcEDC()
- calcEDC
calculates the EDC-field according to the used EDC algorithm
checkEDC
public boolean checkEDC()
- checks the correctness of the given EDC byte (true, if EDC is correct)
getBlock
public byte[] getBlock()
- returns byte array with raw block data
getBlockType
public int getBlockType()
throws T1UnknownBlockException
getNAD
public byte getNAD()
getSourceID
public int getSourceID()
getDestID
public int getDestID()
getPCB
public byte getPCB()
getLEN
public int getLEN()
getDATA
public byte[] getDATA()
getEDC
public int getEDC()
getEDCAlgorithm
public int getEDCAlgorithm()
getControlBits
public int getControlBits()
throws T1Exception
- getControlBits returns block-specific controlbits without the blocktype
toString
public java.lang.String toString()
- toString returns informations about this block object (not yet optimized)
- Overrides:
- toString in class java.lang.Object
getSourceAddress
public int getSourceAddress()
getDestinationAddress
public int getDestinationAddress()
getRequestedSequenceNumber
public int getRequestedSequenceNumber()
throws T1Exception
|