JMRTD 0.4.5

net.sourceforge.scuba.smartcards
Class DummyAcceptingCardService

java.lang.Object
  extended by net.sourceforge.scuba.smartcards.CardService
      extended by net.sourceforge.scuba.smartcards.DummyAcceptingCardService
All Implemented Interfaces:
Serializable

public class DummyAcceptingCardService
extends CardService

A dummy card service to produce APDU traces instead of the actual communication with CAD. So far can only serve APDUs that expect 9000 status words.

Author:
Wojciech Mostowski
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.scuba.smartcards.CardService
listeners, SESSION_STARTED_STATE, SESSION_STOPPED_STATE, state
 
Constructor Summary
DummyAcceptingCardService(PrintStream out)
           
 
Method Summary
 void close()
          Closes the session with the card.
 boolean isOpen()
           
 void open()
          Opens a session with the card.
 ResponseAPDU transmit(CommandAPDU apdu)
          Sends and apdu to the card.
 
Methods inherited from class net.sourceforge.scuba.smartcards.CardService
addAPDUListener, notifyExchangedAPDU, removeAPDUListener, setListenersState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyAcceptingCardService

public DummyAcceptingCardService(PrintStream out)
Method Detail

close

public void close()
Description copied from class: CardService
Closes the session with the card. Disconnects from the card and reader. Notifies any interested apduListeners.

Specified by:
close in class CardService

isOpen

public boolean isOpen()
Specified by:
isOpen in class CardService

open

public void open()
          throws CardServiceException
Description copied from class: CardService
Opens a session with the card. Selects a reader. Connects to the card. Notifies any interested apduListeners.

Specified by:
open in class CardService
Throws:
CardServiceException

transmit

public ResponseAPDU transmit(CommandAPDU apdu)
                      throws CardServiceException
Description copied from class: CardService
Sends and apdu to the card. Notifies any interested apduListeners. This method does not throw a CardServiceException if the ResponseAPDU is status word indicating error.

Specified by:
transmit in class CardService
Parameters:
apdu - the command apdu to send.
Returns:
the response from the card, including the status word.
Throws:
CardServiceException - - if the card operation failed

JMRTD 0.4.5