JMRTD 0.4.6

org.jmrtd.lds
Class COMFile

java.lang.Object
  extended by org.jmrtd.lds.PassportFile
      extended by org.jmrtd.lds.COMFile

public class COMFile
extends PassportFile

File structure for the EF_COM file. This file contains the common data (version and data group presence table) information. FIXME: get rid of all those BERTLVObjects in favor of BERTLVInputStreams. -- MO

Version:
$Revision: 1208 $
Author:
Cees-Bart Breunesse (ceesb@cs.ru.nl), Martijn Oostdijk (martijn.oostdijk@gmail.com)

Field Summary
 
Fields inherited from class org.jmrtd.lds.PassportFile
EF_COM_TAG, EF_DG1_TAG, EF_DG10_TAG, EF_DG11_TAG, EF_DG12_TAG, EF_DG13_TAG, EF_DG14_TAG, EF_DG15_TAG, EF_DG16_TAG, EF_DG2_TAG, EF_DG3_TAG, EF_DG4_TAG, EF_DG5_TAG, EF_DG6_TAG, EF_DG7_TAG, EF_DG8_TAG, EF_DG9_TAG, EF_SOD_TAG
 
Constructor Summary
COMFile(InputStream in)
          Constructs a new EF_COM file based on the encoded value in in.
COMFile(String versionLDS, String updateLevelLDS, String majorVersionUnicode, String minorVersionUnicode, String releaseLevelUnicode, List<Integer> tagList)
          Constructs a new file.
 
Method Summary
 boolean equals(Object other)
          Whether other is equal to this file.
 byte[] getEncoded()
          Gets the contents of this file as byte array, includes the ICAO tag and length.
 String getLDSVersion()
          Gets the LDS version as a dot seperated string containing version and update level.
 int getTag()
          The tag byte of this file.
 List<Integer> getTagList()
          Gets the ICAO datagroup tags as a list of bytes.
 String getUnicodeVersion()
          Gets the unicode version as a dot seperated string containing major version, minor version, and release level.
 int hashCode()
           
 void insertTag(Integer tag)
          Inserts a tag in a proper place if not already present
 String toString()
          Gets a textual representation of this file.
 
Methods inherited from class org.jmrtd.lds.PassportFile
createPassportFile, lookupDataGroupNumberByTag, lookupFIDByDataGroupNumber, lookupFIDByTag, lookupTagByDataGroupNumber, lookupTagByFID, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

COMFile

public COMFile(String versionLDS,
               String updateLevelLDS,
               String majorVersionUnicode,
               String minorVersionUnicode,
               String releaseLevelUnicode,
               List<Integer> tagList)
Constructs a new file.

Parameters:
versionLDS - a numerical string of length 2
updateLevelLDS - a numerical string of length 2
majorVersionUnicode - a numerical string of length 2
minorVersionUnicode - a numerical string of length 2
releaseLevelUnicode - a numerical string of length 2
tagList - a list of ICAO data group tags
Throws:
IllegalArgumentException - if the input is not well-formed

COMFile

public COMFile(InputStream in)
        throws IOException
Constructs a new EF_COM file based on the encoded value in in.

Parameters:
in - should contain a TLV object with appropriate tag and contents
Throws:
IOException - if the input could not be decoded
Method Detail

getTag

public int getTag()
The tag byte of this file.

Returns:
the tag

getLDSVersion

public String getLDSVersion()
Gets the LDS version as a dot seperated string containing version and update level.

Returns:
a string of the form "aa.bb"

getUnicodeVersion

public String getUnicodeVersion()
Gets the unicode version as a dot seperated string containing major version, minor version, and release level.

Returns:
a string of the form "aa.bb.cc"

getTagList

public List<Integer> getTagList()
Gets the ICAO datagroup tags as a list of bytes.

Returns:
a list of bytes

insertTag

public void insertTag(Integer tag)
Inserts a tag in a proper place if not already present

Parameters:
tag -

getEncoded

public byte[] getEncoded()
Description copied from class: PassportFile
Gets the contents of this file as byte array, includes the ICAO tag and length.

Specified by:
getEncoded in class PassportFile
Returns:
a byte array containing the file

toString

public String toString()
Gets a textual representation of this file.

Overrides:
toString in class Object
Returns:
a textual representation of this file

equals

public boolean equals(Object other)
Whether other is equal to this file.

Overrides:
equals in class Object
Returns:
a boolean

hashCode

public int hashCode()
Overrides:
hashCode in class Object

JMRTD 0.4.6