readBinaryBySFI method
Sends READ BINARY command to ICC.
It returns file's ne long chunk of data at offset.
File is identified by sfi.
Max offset can be 255.
Can throw ICCError if R-APDU returns no data and error status or ComProviderError.
Implementation
Future<ResponseAPDU> readBinaryBySFI({ required int sfi, required int offset, required int ne, int cla = ISO7816_CLA.NO_SM }) async {
if(offset > 255) {
throw ArgumentError.value(offset, null, "readBinaryBySFI: Max offset can be 256 bytes");
}
if((sfi & 0x80) == 0) { // bit 8 must be set
throw ArgumentError.value(offset, null, "readBinaryBySFI: Invalid SFI identifier");
}
return await _readBinary(
CommandAPDU(cla: cla, ins: ISO7816_INS.READ_BINARY, p1: sfi, p2: offset, ne: ne)
);
}