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

com.ibm.opencard.service
Class MFC35Codes

java.lang.Object
  |
  +--com.ibm.opencard.service.MFC35Codes
Direct Known Subclasses:
MFC40SigCodes, MFC41Codes

public class MFC35Codes
extends java.lang.Object
implements MFCCodes

CLAss and INStruction codes for MFC 3.5 and 4.0 smartcards. This class implements exactly the interface MFCCodes. Most methods are trivial and therefore not commented.

Version:
$Id: MFC35Codes.java,v 1.1 1999/12/02 16:06:06 damke Exp $
See Also:
MFCCodes

Field Summary
static byte OP_UNKNOWN
          The code for an unknown operation.
 
Constructor Summary
MFC35Codes()
           
 
Method Summary
 void analyseStatus(int status, byte command, java.lang.Object context)
          Analyses the status of a smartcard's response to a command.
 int getAG(int operation)
           
 byte getAskRandomByte()
           
 int getBlockSize()
           
 byte getClassByte()
           
 byte getINS(int operation)
           
 byte getISOClassByte()
           
 byte getReadRecordByte()
           
 boolean indicatesError(int status)
          Checks whether the response status indicates an error.
 boolean needsZeroLc()
           
 boolean needsZeroLe()
           
 boolean needsZeroLe(boolean info)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_UNKNOWN

public static final byte OP_UNKNOWN
The code for an unknown operation.
Constructor Detail

MFC35Codes

public MFC35Codes()
Method Detail

getBlockSize

public int getBlockSize()
Specified by:
getBlockSize in interface MFCCodes

needsZeroLc

public boolean needsZeroLc()
Specified by:
needsZeroLc in interface MFCCodes

needsZeroLe

public boolean needsZeroLe()
Specified by:
needsZeroLe in interface MFCCodes

needsZeroLe

public boolean needsZeroLe(boolean info)
Specified by:
needsZeroLe in interface MFCCodes

getINS

public byte getINS(int operation)
Specified by:
getINS in interface MFCCodes

getAG

public int getAG(int operation)
Specified by:
getAG in interface MFCCodes

getISOClassByte

public byte getISOClassByte()
Specified by:
getISOClassByte in interface MFCCodes

getClassByte

public byte getClassByte()
Specified by:
getClassByte in interface MFCCodes

getReadRecordByte

public byte getReadRecordByte()
Specified by:
getReadRecordByte in interface MFCCodes

getAskRandomByte

public byte getAskRandomByte()
Specified by:
getAskRandomByte in interface MFCCodes

analyseStatus

public void analyseStatus(int status,
                          byte command,
                          java.lang.Object context)
                   throws CardServiceException
Analyses the status of a smartcard's response to a command. If the command completed successfully, the method returns without further action. If an error occurred, an exception is thrown. This method uses indicatesError to determine whether an exception has to be thrown.
Specified by:
analyseStatus in interface MFCCodes
Parameters:
status - the status word returned by the smartcard
command - the INStruction sent to the smartcard
context - the context in which the command was issued
Throws:
CardServiceException - iff the status indicates an error
See Also:
indicatesError(int)

indicatesError

public boolean indicatesError(int status)
Checks whether the response status indicates an error. If so, true is returned.
Specified by:
indicatesError in interface MFCCodes
Parameters:
status - the status returned by the smartcard
Returns:
false if the command completed successfully, true otherwise