com.sun.javacard.apduio
Class CadT0Client

java.lang.Object
  extended by com.sun.javacard.apduio.CadDevice
      extended by com.sun.javacard.apduio.CadT0
          extended by 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
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
CadT0Client(java.io.InputStream in, java.io.OutputStream out)
           
 
Method Summary
 void exchangeApdu(Apdu apdu)
          Exchange an Apdu with a CAD.
 void powerDown()
          Powerdown a card or simulator and then disconnect
 void 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

responseMsg

protected TLP224Message responseMsg

commandMsg

protected TLP224Message commandMsg

protocol

protected ClientProtocol protocol
Constructor Detail

CadT0Client

public CadT0Client(java.io.InputStream in,
                   java.io.OutputStream out)
Method Detail

exchangeApdu

public void exchangeApdu(Apdu apdu)
                  throws java.io.IOException,
                         CadTransportException
Exchange an Apdu with a CAD.

Specified by:
exchangeApdu in interface CadClientInterface
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 interface CadClientInterface
Throws:
java.io.IOException - Communication error
CadTransportException - 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 interface CadClientInterface
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 interface CadClientInterface
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


Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.