com.sun.javacard.apduio
Class CadPCSCClient

java.lang.Object
  extended by com.sun.javacard.apduio.CadDevice
      extended by com.sun.javacard.apduio.CadPCSCClient
All Implemented Interfaces:
CadClientInterface

public class CadPCSCClient
extends CadDevice
implements CadClientInterface

The CadClient 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

Field Summary
protected static java.util.ResourceBundle _messages
           
protected  ClientPCSCProtocol protocol
           
 
Fields inherited from class com.sun.javacard.apduio.CadDevice
debug, deviceProtocol, in, out, PROTOCOL_PCSC, PROTOCOL_T0, PROTOCOL_T1, PROTOCOL_TCL
 
Constructor Summary
CadPCSCClient(int readerNumber)
           
 
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)
          Send powerdown to a card
 byte[] powerUp()
          Send powerup to a card or a simulator
 
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

protocol

protected ClientPCSCProtocol protocol

_messages

protected static java.util.ResourceBundle _messages
Constructor Detail

CadPCSCClient

public CadPCSCClient(int readerNumber)
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(boolean disconnect)
               throws java.io.IOException,
                      CadTransportException
Description copied from interface: CadClientInterface
Send powerdown to a card

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:
java.io.IOException - Communication error
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

powerUp

public byte[] powerUp()
               throws java.io.IOException,
                      CadTransportException
Description copied from interface: CadClientInterface
Send powerup to a card or a simulator

Specified by:
powerUp in interface CadClientInterface
Returns:
ATR bytes
Throws:
java.io.IOException - Communication error
CadTransportException - Protocol error


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