Class ReadBinaryAPDUSender

    • Constructor Detail

      • ReadBinaryAPDUSender

        public ReadBinaryAPDUSender​(net.sf.scuba.smartcards.CardService service)
        Creates an APDU sender.
        Parameters:
        service - the card service for tranceiving APDUs
    • Method Detail

      • sendSelectApplet

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

        public void sendSelectFile​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                                   short fid)
                            throws net.sf.scuba.smartcards.CardServiceException
        Sends a SELECT FILE command to the passport. Secure messaging will be applied to the command and response apdu.
        Specified by:
        sendSelectFile in interface APDULevelReadBinaryCapable
        Parameters:
        wrapper - the secure messaging wrapper to use
        fid - the file to select
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on tranceive error
      • sendReadBinary

        public 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.
        Specified by:
        sendReadBinary in interface APDULevelReadBinaryCapable
        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 is true, of 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