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

com.ibm.opencard.service
Class MFC41CardServiceImpl

java.lang.Object
  |
  +--com.ibm.opencard.service.MFC35CardServiceImpl
        |
        +--com.ibm.opencard.service.MFC41CardServiceImpl

public class MFC41CardServiceImpl
extends MFC35CardServiceImpl

Implementation of generic card services for MFC 4.1 and above. This class extends the generic card services for MFC 3.5 and above by the capability of selection by application name.

Version:
$Id: MFC41CardServiceImpl.java,v 1.1 1999/12/02 16:06:07 damke Exp $

Field Summary
protected  byte[] application_id
           
protected  byte p1_application_id
          The P1 byte for select by application.
 
Fields inherited from class com.ibm.opencard.service.MFC35CardServiceImpl
info_required, last_response, mfc_codes, p1_file_id, p1_path_abs, p1_path_rel, p2_select_info, p2_select_quiet, path_absolute, path_component, path_error, path_length, select_apdu
 
Constructor Summary
MFC41CardServiceImpl(MFCCodes codes)
          Creates a new generic card service implementation for MFC 4.1 and above.
 
Method Summary
protected  void execSelect(MFCCardChannel chan, boolean info)
          Select the path that is stored by now.
protected  void nextSelect(MFCCardChannel chan, CardFilePathComponent comp)
          Add a path component to the current select operation.
 
Methods inherited from class com.ibm.opencard.service.MFC35CardServiceImpl
clearPath, determinePath, doneSelect, execCommand, initSelect, performSelect, selectObject, sendSelectAPDU
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

p1_application_id

protected byte p1_application_id
The P1 byte for select by application. The default value can be considered 'final' for MFC smartcards. For other cards, like the GeldKarte, a different value may be assigned in the constructor of a derived class.

application_id

protected byte[] application_id
Constructor Detail

MFC41CardServiceImpl

public MFC41CardServiceImpl(MFCCodes codes)
Creates a new generic card service implementation for MFC 4.1 and above.
Parameters:
codes - the CLAss and INStruction codes for the smartcard
Method Detail

nextSelect

protected void nextSelect(MFCCardChannel chan,
                          CardFilePathComponent comp)
                   throws CardTerminalException
Add a path component to the current select operation. If necessary, a command with the previously added components will be sent to the smartcard. This method checks only for application identifiers. Any other components will be passed to the base class implementation.
Application identifiers are solitaire path components. They require a select command of their own. If an application ID has been stored by a previous invocation, the command will be executed now. If the component just passed is an application ID, and the path composed from previous invocations is not empty, a select command will be executed before the application ID is stored.
Parameters:
chan - the contact to the smartcard
comp - the path component to add
Throws:
CardTerminalException - if the terminal encountered an error
Overrides:
nextSelect in class MFC35CardServiceImpl
See Also:
execSelect(com.ibm.opencard.service.MFCCardChannel, boolean)

execSelect

protected void execSelect(MFCCardChannel chan,
                          boolean info)
                   throws CardTerminalException
Select the path that is stored by now. This method checks whether the path currently stored consists of an application ID. If so, it issues a corresponding select command, and the response is stored in last_response. Otherwise, the base class implementation is invoked. In any case, the currently stored path is empty after this method returns.
Parameters:
chan - the channel to the smartcard
info - true if the file info is needed
Throws:
CardTerminalException - if the terminal encountered an error
Overrides:
execSelect in class MFC35CardServiceImpl
See Also:
MFC35CardServiceImpl.last_response