Package com.sun.javacard.apduio
Class CadT0Client
- java.lang.Object
-
- com.sun.javacard.apduio.CadDevice
-
- com.sun.javacard.apduio.CadT0
-
- com.sun.javacard.apduio.CadT0Client
-
- All Implemented Interfaces:
CadClientInterface
public class CadT0Client extends CadT0 implements CadClientInterface
The CadT0Client class maintains the context for the client (terminal) side of the terminal CAD connection. This class works in associate of the ClientProtocol and ClientT0Protocol classes- See Also:
ClientProtocol
,ClientT0Protocol
-
-
Field Summary
Fields Modifier and Type Field Description protected TLP224Message
commandMsg
protected ClientProtocol
protocol
protected TLP224Message
responseMsg
-
Fields inherited from class com.sun.javacard.apduio.CadDevice
_messages, debug, deviceProtocol, in, out, PROTOCOL_PCSC, PROTOCOL_T0, PROTOCOL_T1, PROTOCOL_TCL
-
-
Constructor Summary
Constructors Constructor Description CadT0Client(java.io.InputStream in, java.io.OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exchangeApdu(Apdu apdu)
Exchange an Apdu with a CAD.void
powerDown()
Powerdown a card or simulator and then disconnectvoid
powerDown(boolean disconnect)
This command sends a POWER_DOWN command to the CAD.byte[]
powerUp()
This command sends a POWER_UP command to the CAD.-
Methods inherited from class com.sun.javacard.apduio.CadT0
receiveTLP224Message, sendTLP224Message
-
Methods inherited from class com.sun.javacard.apduio.CadDevice
close, getCadClientInstance, getDeviceProtocol, getPCSCClientInstance
-
-
-
-
Field Detail
-
responseMsg
protected TLP224Message responseMsg
-
commandMsg
protected TLP224Message commandMsg
-
protocol
protected ClientProtocol protocol
-
-
Method Detail
-
exchangeApdu
public void exchangeApdu(Apdu apdu) throws java.io.IOException, CadTransportException
Exchange an Apdu with a CAD.- Specified by:
exchangeApdu
in interfaceCadClientInterface
- Parameters:
apdu
- The Apdu to send and receive data from.- Throws:
TLP224Exception
- if the CAD has not been powered up.java.io.IOException
- if a communication error happens while communicating with the CAD.CadTransportException
- Protocol error
-
powerDown
public void powerDown() throws java.io.IOException, CadTransportException
Description copied from interface:CadClientInterface
Powerdown a card or simulator and then disconnect- Specified by:
powerDown
in interfaceCadClientInterface
- Throws:
java.io.IOException
- Communication errorCadTransportException
- Protocol error
-
powerDown
public void powerDown(boolean disconnect) throws java.io.IOException, CadTransportException
This command sends a POWER_DOWN command to the CAD.- Specified by:
powerDown
in interfaceCadClientInterface
- Parameters:
disconnect
- This parameter is applicable to card simulators only. true = disconnect from the simulator false = powedown, but leave the connection open- Throws:
TLP224Exception
- if the CAD is unable to power down correctly.java.io.IOException
- if a communication error happens while communicating with the CAD.CadTransportException
- Protocol error
-
powerUp
public byte[] powerUp() throws java.io.IOException, CadTransportException
This command sends a POWER_UP command to the CAD.- Specified by:
powerUp
in interfaceCadClientInterface
- Returns:
- a byte array containing the ATR received from the CAD.
- Throws:
TLP224Exception
- if the CAD is unable to power up correctly.java.io.IOException
- if a communication error happens while communicating with the CAD.CadTransportException
- Protocol error
-
-