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

com.ibm.opencard.access
Class MFCAccessorFactory

java.lang.Object
  |
  +--com.ibm.opencard.access.MFCAccessorFactory
Direct Known Subclasses:
MFCSMAccessorFactory

public class MFCAccessorFactory
extends java.lang.Object

A factory class for creating card accessors. Here, the term factory refers to the design technique, not to OCF card service factories. The MFC card services use card accessors to satisfy access conditions. MFC access conditions include simple ones like password protection (CHV) as well as cryptographic ones. Since cryptography causes problems with US export restrictions, accessors are created in their own factory. One factory supports export free password protection, the other one supports cryptographic accessors, too. The Java reflection functionality is used to decide whether the export restricted accessor features are available.

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

Constructor Summary
protected MFCAccessorFactory()
          Instantiates a factory for export free accessors.
 
Method Summary
static MFCAccessParser getACParser(int cos)
          Returns a parser for access conditions.
static MFCCardAccessor newAccessor(int cos)
          Creates a new card accessor.
protected  MFCCardAccessor newCardAccessor(int cos)
          Creates a new export free card accessor.
static void setName(java.lang.String name)
          Provides the name of an extended accessor factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MFCAccessorFactory

protected MFCAccessorFactory()
Instantiates a factory for export free accessors.
Method Detail

setName

public static void setName(java.lang.String name)
Provides the name of an extended accessor factory. This method has to be invoked before newAccessor is invoked for the first time. On the first invocation of that method, it is checked whether the class with the given name can be instantiated. If so, it is used as the accessor factory. Otherwise, this factory will be used to create export free accessors.
If this method is not invoked in time, the default name will be used. The default name is that of IBM's accessor factory supporting crypto access conditions.
Parameters:
name - the name of an extended accessor factory class
See Also:
newAccessor(int)

newAccessor

public static MFCCardAccessor newAccessor(int cos)
Creates a new card accessor. On the first invocation of this method, an accessor factory will be created and stored in accessor_factory. This factory will be used for creating card accessors until the virtual machine terminates. This method invokes newCardAccessor on the factory and returns the result.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
a newly created card accessor
See Also:
newCardAccessor(int), IBMMFCConstants

newCardAccessor

protected MFCCardAccessor newCardAccessor(int cos)
Creates a new export free card accessor. The card accessor returned supports password input (CHV), but neither authetication nor protection nor encryption. This method can be overridden to return an extended accessor. It is invoked by newAccessor.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
a newly created card accessor
See Also:
newAccessor(int), IBMMFCConstants

getACParser

public static MFCAccessParser getACParser(int cos)
Returns a parser for access conditions. Currently, there is only one access condition parser for all MFC cards. The parser is created on the first invocation and re-used later. It is needed by select response parsers.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
an access condition parser for the CardOS
See Also:
IBMMFCConstants, MFCSelectResponseParser