JMRTD 0.4.5

net.sourceforge.scuba.smartcards
Class AbstractFileSystemStructured

java.lang.Object
  extended by net.sourceforge.scuba.smartcards.AbstractFileSystemStructured
All Implemented Interfaces:
FileSystemStructured

public abstract class AbstractFileSystemStructured
extends Object
implements FileSystemStructured

This class implements some basic file selection / reading / writing routines from the ISO7816-4 standard. TODO: Work in heavy progress

Author:
woj

Field Summary
static short MF_ID
           
 
Constructor Summary
AbstractFileSystemStructured(CardService service)
           
AbstractFileSystemStructured(CardService service, boolean fileInfo)
           
 
Method Summary
 int getFileLength()
           
 short getSelectedFID()
           
 byte[] readBinary(int offset, int length)
          Reads a fragment of the currently selected file.
 void selectAID(byte[] aid)
           
 void selectDFRelative(short fid)
           
 void selectEFRelative(short fid)
           
 void selectFile(short fid)
          Selects a file.
 void selectMF()
           
 void selectParent()
           
 void selectPath(byte[] path)
           
 void selectPathRelative(byte[] path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.scuba.smartcards.FileSystemStructured
getSelectedPath
 

Field Detail

MF_ID

public static short MF_ID
Constructor Detail

AbstractFileSystemStructured

public AbstractFileSystemStructured(CardService service)

AbstractFileSystemStructured

public AbstractFileSystemStructured(CardService service,
                                    boolean fileInfo)
Method Detail

getFileLength

public int getFileLength()
                  throws CardServiceException
Throws:
CardServiceException

getSelectedFID

public short getSelectedFID()

readBinary

public byte[] readBinary(int offset,
                         int length)
                  throws CardServiceException
Description copied from interface: FileSystemStructured
Reads a fragment of the currently selected file.

Specified by:
readBinary in interface FileSystemStructured
Parameters:
offset - offset
length - the number of bytes to read (the result may be shorter, though)
Returns:
contents of currently selected file, contains at least 1 byte, at most length.
Throws:
CardServiceException - on error (for instance: end of file)

selectFile

public void selectFile(short fid)
                throws CardServiceException
Description copied from interface: FileSystemStructured
Selects a file.

Specified by:
selectFile in interface FileSystemStructured
Parameters:
fid - indicates which file to select
Throws:
CardServiceException - in case of error

selectMF

public void selectMF()
              throws CardServiceException
Throws:
CardServiceException

selectParent

public void selectParent()
                  throws CardServiceException
Throws:
CardServiceException

selectEFRelative

public void selectEFRelative(short fid)
                      throws CardServiceException
Throws:
CardServiceException

selectDFRelative

public void selectDFRelative(short fid)
                      throws CardServiceException
Throws:
CardServiceException

selectAID

public void selectAID(byte[] aid)
               throws CardServiceException
Throws:
CardServiceException

selectPath

public void selectPath(byte[] path)
                throws CardServiceException
Throws:
CardServiceException

selectPathRelative

public void selectPathRelative(byte[] path)
                        throws CardServiceException
Throws:
CardServiceException

JMRTD 0.4.5