Package org.jmrtd

Interface APDULevelReadBinaryCapable

  • All Known Implementing Classes:
    ReadBinaryAPDUSender

    public interface APDULevelReadBinaryCapable
    The low-level capability for reading files using SELECT and READ BINARY (both SFI and non-SFI) commands. The actual file system on an ICAO compliant chip supports this.
    Since:
    0.7.0
    Version:
    $Revision: 1781 $
    Author:
    The JMRTD team (info@jmrtd,org)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte[] sendReadBinary​(net.sf.scuba.smartcards.APDUWrapper wrapper, int sfi, int offset, int le, boolean isSFIEnabled, boolean isTLVEncodedOffsetNeeded)
      Sends a READ BINARY command to the passport.
      void sendSelectApplet​(net.sf.scuba.smartcards.APDUWrapper wrapper, byte[] aid)
      Sends a SELECT APPLET command to the card.
      void sendSelectFile​(net.sf.scuba.smartcards.APDUWrapper wrapper, short fid)
      Selects a file by file identifier.
    • Method Detail

      • sendSelectApplet

        void sendSelectApplet​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                              byte[] aid)
                       throws net.sf.scuba.smartcards.CardServiceException
        Sends a SELECT APPLET command to the card.
        Parameters:
        wrapper - the secure messaging wrapper to use
        aid - the applet to select
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on tranceive error
      • sendSelectFile

        void sendSelectFile​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                            short fid)
                     throws net.sf.scuba.smartcards.CardServiceException
        Selects a file by file identifier.
        Parameters:
        wrapper - the APDU wrapper to use
        fid - the file identifier
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on error
      • sendReadBinary

        byte[] sendReadBinary​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                              int sfi,
                              int offset,
                              int le,
                              boolean isSFIEnabled,
                              boolean isTLVEncodedOffsetNeeded)
                       throws net.sf.scuba.smartcards.CardServiceException
        Sends a READ BINARY command to the passport. Secure messaging will be applied to the command and response APDU.
        Parameters:
        wrapper - the secure messaging wrapper to use, or null for none
        sfi - the short file identifier byte of the file to read as an int value (between 0 and 255) only if isSFIEnabled is true, if not any value)
        offset - offset into the file (either a value between 0 and 255 if isSFIEnabled holds, or a value between 0 and 65535 if not)
        le - the expected length of the file to read
        isSFIEnabled - a boolean indicating whether short file identifiers are used
        isTLVEncodedOffsetNeeded - a boolean indicating whether it should be a long (INS == 0xB1) read
        Returns:
        a byte array of length at most le with (the specified part of) the contents of the currently selected file
        Throws:
        net.sf.scuba.smartcards.CardServiceException - if the command was not successful