JMRTD 0.4.5

org.jmrtd.lds
Class PassportFile

java.lang.Object
  extended by org.jmrtd.lds.PassportFile
Direct Known Subclasses:
COMFile, CVCAFile, DataGroup, SODFile

public abstract class PassportFile
extends Object

Super class for passport files (EF_COM, EF_SOD, and data groups).

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

Field Summary
static int EF_COM_TAG
          ICAO specific datagroup tag.
static int EF_DG1_TAG
          ICAO specific datagroup tag.
static int EF_DG10_TAG
          ICAO specific datagroup tag.
static int EF_DG11_TAG
          ICAO specific datagroup tag.
static int EF_DG12_TAG
          ICAO specific datagroup tag.
static int EF_DG13_TAG
          ICAO specific datagroup tag.
static int EF_DG14_TAG
          ICAO specific datagroup tag.
static int EF_DG15_TAG
          ICAO specific datagroup tag.
static int EF_DG16_TAG
          ICAO specific datagroup tag.
static int EF_DG2_TAG
          ICAO specific datagroup tag.
static int EF_DG3_TAG
          ICAO specific datagroup tag.
static int EF_DG4_TAG
          ICAO specific datagroup tag.
static int EF_DG5_TAG
          ICAO specific datagroup tag.
static int EF_DG6_TAG
          ICAO specific datagroup tag.
static int EF_DG7_TAG
          ICAO specific datagroup tag.
static int EF_DG8_TAG
          ICAO specific datagroup tag.
static int EF_DG9_TAG
          ICAO specific datagroup tag.
static int EF_SOD_TAG
          ICAO specific datagroup tag.
 
Method Summary
static PassportFile createPassportFile(InputStream in)
          Factory method for creating passport files for a given input stream.
abstract  byte[] getEncoded()
          Gets the contents of this file as byte array, includes the ICAO tag and length.
static int lookupDataGroupNumberByTag(int tag)
          Finds a data group number for an ICAO tag.
static short lookupFIDByDataGroupNumber(int number)
          Finds an ICAO tag for a data group number.
static short lookupFIDByTag(int tag)
          Finds a file identifier for an ICAO tag.
static int lookupTagByDataGroupNumber(int number)
          Finds an ICAO tag for a data group number.
static short lookupTagByFID(short fid)
          Finds an ICAO tag for a file identifier.
static String toString(int tag)
          Returns a mnemonic name corresponding to the file represented by the given ICAO tag, such as "EF_COM", "EF_SOD", or "EF_DG1".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EF_COM_TAG

public static final int EF_COM_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG1_TAG

public static final int EF_DG1_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG2_TAG

public static final int EF_DG2_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG3_TAG

public static final int EF_DG3_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG4_TAG

public static final int EF_DG4_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG5_TAG

public static final int EF_DG5_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG6_TAG

public static final int EF_DG6_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG7_TAG

public static final int EF_DG7_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG8_TAG

public static final int EF_DG8_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG9_TAG

public static final int EF_DG9_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG10_TAG

public static final int EF_DG10_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG11_TAG

public static final int EF_DG11_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG12_TAG

public static final int EF_DG12_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG13_TAG

public static final int EF_DG13_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG14_TAG

public static final int EF_DG14_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG15_TAG

public static final int EF_DG15_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_DG16_TAG

public static final int EF_DG16_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values

EF_SOD_TAG

public static final int EF_SOD_TAG
ICAO specific datagroup tag. There is also the CVCA file that has no tag!

See Also:
Constant Field Values
Method Detail

getEncoded

public abstract byte[] getEncoded()
Gets the contents of this file as byte array, includes the ICAO tag and length.

Returns:
a byte array containing the file

createPassportFile

public static PassportFile createPassportFile(InputStream in)
                                       throws IOException
Factory method for creating passport files for a given input stream.

Parameters:
in - a given input stream
Returns:
a specific file
Throws:
IOException - on reading error from the input stream

lookupFIDByTag

public static short lookupFIDByTag(int tag)
Finds a file identifier for an ICAO tag. Corresponds to Table A1 in ICAO-TR-LDS_1.7_2004-05-18.

Parameters:
tag - an ICAO tag (the first byte of the EF)
Returns:
a file identifier.

lookupDataGroupNumberByTag

public static int lookupDataGroupNumberByTag(int tag)
Finds a data group number for an ICAO tag.

Parameters:
tag - an ICAO tag (the first byte of the EF)
Returns:
a data group number (1-16)

lookupTagByDataGroupNumber

public static int lookupTagByDataGroupNumber(int number)
Finds an ICAO tag for a data group number.

Parameters:
number - a data group number (1-16)
Returns:
an ICAO tag (the first byte of the EF)

lookupFIDByDataGroupNumber

public static short lookupFIDByDataGroupNumber(int number)
Finds an ICAO tag for a data group number.

Parameters:
number - a data group number (1-16)
Returns:
a file identifier

lookupTagByFID

public static short lookupTagByFID(short fid)
Finds an ICAO tag for a file identifier. Corresponds to Table A1 in ICAO-TR-LDS_1.7_2004-05-18.

Parameters:
fid - a file identifier
Returns:
a an ICAO tag (first byte of EF)

toString

public static String toString(int tag)
Returns a mnemonic name corresponding to the file represented by the given ICAO tag, such as "EF_COM", "EF_SOD", or "EF_DG1".

Parameters:
tag - an ICAO tag (the first byte of the EF)
Returns:
a mnemonic name corresponding to the file represented by the given ICAO tag

JMRTD 0.4.5