Package org.jmrtd.protocol
Class ReadBinaryAPDUSender
- java.lang.Object
-
- org.jmrtd.protocol.ReadBinaryAPDUSender
-
- All Implemented Interfaces:
APDULevelReadBinaryCapable
public class ReadBinaryAPDUSender extends Object implements APDULevelReadBinaryCapable
An APDU sender to support reading binaries. both selection and short file identifier based.- Since:
- 0.7.0
- Version:
- $Revision: 1781 $
- Author:
- The JMRTD team ([email protected])
-
-
Constructor Summary
Constructors Constructor Description ReadBinaryAPDUSender(net.sf.scuba.smartcards.CardService service)
Creates an APDU sender.
-
Method Summary
All Methods Instance Methods Concrete 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 aREAD BINARY
command to the passport.void
sendSelectApplet(net.sf.scuba.smartcards.APDUWrapper wrapper, byte[] aid)
Sends aSELECT APPLET
command to the card.void
sendSelectFile(net.sf.scuba.smartcards.APDUWrapper wrapper, short fid)
Sends aSELECT FILE
command to the passport.
-
-
-
Method Detail
-
sendSelectApplet
public void sendSelectApplet(net.sf.scuba.smartcards.APDUWrapper wrapper, byte[] aid) throws net.sf.scuba.smartcards.CardServiceException
Sends aSELECT APPLET
command to the card.- Specified by:
sendSelectApplet
in interfaceAPDULevelReadBinaryCapable
- Parameters:
wrapper
- the secure messaging wrapper to useaid
- 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 aSELECT FILE
command to the passport. Secure messaging will be applied to the command and response apdu.- Specified by:
sendSelectFile
in interfaceAPDULevelReadBinaryCapable
- Parameters:
wrapper
- the secure messaging wrapper to usefid
- 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 aREAD BINARY
command to the passport. Secure messaging will be applied to the command and response APDU.- Specified by:
sendReadBinary
in interfaceAPDULevelReadBinaryCapable
- Parameters:
wrapper
- the secure messaging wrapper to use, ornull
for nonesfi
- the short file identifier byte of the file to read as an int value (between 0 and 255) only ifisSFIEnabled
istrue
, if not any value)offset
- offset into the file (either a value between 0 and 255 ifisSFIEnabled
istrue
, of a value between 0 and 65535 if not)le
- the expected length of the file to readisSFIEnabled
- a boolean indicating whether short file identifiers are usedisTLVEncodedOffsetNeeded
- 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
-
-