OpenCard  
 
OCF, the OpenCard Framework is a standard Java framework for working with Smart Cards.  
 

com.ibm.opencard.service
Class MFCCardServiceParameter

java.lang.Object
  |
  +--com.ibm.opencard.service.MFCCardServiceParameter
Direct Known Subclasses:
MFCFileParameter, MFCSignatureParameter

public class MFCCardServiceParameter
extends java.lang.Object

Encapsulation of the constructor arguments of MFCCardService. The number of arguments to a card service is rather high. To simplify the construction, this object encapsulates all parameters required for the generic card service, except an optional pre-allocated channel. Every parameter can be set explicitly by a method invocation. Access to the parameters stored is provided only within this package and subclasses.

Version:
$Id: MFCCardServiceParameter.java,v 1.1 1999/12/02 16:06:07 damke Exp $
See Also:
MFCCardService

Field Summary
protected  CardAccessor card_accessor
          The accessor that may be needed in derived card services.
protected  CardServiceScheduler cs_scheduler
          The scheduler required to allocate channels.
protected  boolean is_blocking
          Whether channel allocation is blocking.
protected  MFCSelectResponseParser select_parser
          The parser for responses to the SELECT command.
protected  MFCCardServiceImpl service_impl
          The implementation of the generic card service.
protected  SmartCard smart_card
          The smartcard object representing the smartcard to contact.
 
Constructor Summary
MFCCardServiceParameter()
          Creates new parameters, initialized with null.
MFCCardServiceParameter(CardServiceScheduler scheduler, SmartCard smartcard, boolean blocking)
          Creates new parameters, the standard ones already set.
 
Method Summary
 void setAccessor(CardAccessor accessor)
          Set the accessor that will handle secure messaging.
 void setCardServiceImpl(MFCCardServiceImpl csimpl)
          Set the MFCCardServiceImpl instance to use.
 void setScheduler(CardServiceScheduler scheduler)
          Set the scheduler for channel allocation.
 void setSelectResponseParser(MFCSelectResponseParser srparser)
          Set the MFCSelectResponseParser instance to use.
 void setSmartCard(SmartCard smartcard)
          Set the smartcard to contact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cs_scheduler

protected CardServiceScheduler cs_scheduler
The scheduler required to allocate channels.

smart_card

protected SmartCard smart_card
The smartcard object representing the smartcard to contact.

is_blocking

protected boolean is_blocking
Whether channel allocation is blocking.

service_impl

protected MFCCardServiceImpl service_impl
The implementation of the generic card service.

select_parser

protected MFCSelectResponseParser select_parser
The parser for responses to the SELECT command.

card_accessor

protected CardAccessor card_accessor
The accessor that may be needed in derived card services.
Constructor Detail

MFCCardServiceParameter

public MFCCardServiceParameter()
Creates new parameters, initialized with null. All parameters required for instantiating a generic MFCCardService must be set explicitly afterwards.
See Also:
MFCCardService

MFCCardServiceParameter

public MFCCardServiceParameter(CardServiceScheduler scheduler,
                               SmartCard smartcard,
                               boolean blocking)
Creates new parameters, the standard ones already set. In the first version of OCF, all card services had the same constructor arguments. This constructor expects those arguments, and stores them. The remaining arguments required for instantiating a generic MFCCardService have to be set explicitly after construction.
Parameters:
scheduler - where to allocate channels
smartcard - the smartcard to contact
blocking - whether channel allocation blocks
See Also:
MFCCardService
Method Detail

setScheduler

public final void setScheduler(CardServiceScheduler scheduler)
Set the scheduler for channel allocation. A card service has to allocate a channel to the smartcard before issuing a command, and release it afterwards. This method can be used to set the scheduler that is responsible for managing the channels to the smartcard for which the card service has to be instantiated.
Parameters:
scheduler - the scheduler for channel allocation
See Also:
CardServiceScheduler

setSmartCard

public final void setSmartCard(SmartCard smartcard)
Set the smartcard to contact. Card services get instantiated for a specific smartcard that has been inserted into one of the slots of one of the card terminals. This method can be used to set the object of class SmartCard that represents the smartcard that will be contacted by the service to be instantiated.
Parameters:
smartcard - the SmartCard to contact by the card service
See Also:
SmartCard

setCardServiceImpl

public final void setCardServiceImpl(MFCCardServiceImpl csimpl)
Set the MFCCardServiceImpl instance to use. The generic card service relies on a card service implementation which is responsible for creating commands to send to the smartcard and for interpreting the response. This method sets the instance of this interface that will be used.
Parameters:
csimpl - the MFCCardServiceImpl instance for the generic card service

setSelectResponseParser

public final void setSelectResponseParser(MFCSelectResponseParser srparser)
Set the MFCSelectResponseParser instance to use. The generic card service offers a method to select an object on the smartcard. This object can be a file, a key, or something else. The smartcard will return status information on the selected object, which has to be interpreted according to the object type.
This method sets the instance that will parse select responses for the card service to create. It is assumed that a card service deals with only one kind of objects that get selected, for example files in a file service or keys in a signature service.
Parameters:
srparser - the MFCSelectResponseParser instance for the card service to instantiate

setAccessor

public final void setAccessor(CardAccessor accessor)
Set the accessor that will handle secure messaging. Secure messaging, as well as card holder verification and other access conditions, are not required for the generic card service. Since the derived services rely on an accessor that handles this stuff, it is supported in the base class.
Parameters:
accessor - the CardAccessor that satisfies access conditions