def get_data(self, msb_tag, lsb_tag): """ Returns the command/response pair for the GET DATA command. The msb_tag and lsb_tag represent the most significant and least significant part of the tag byte respectively.""" # GET DATA command encoding. # Same problem as in READ RECORD. See read_record() for more details. tmp = CommandAPDU(0x80, 0xca, msb_tag, lsb_tag).getBytes() tmp.append(0) command = CommandAPDU(tmp) return self.send_command(command)
def read_record(self, sfi, rnbr): # read record command encoding. # command = CommandAPDU(0x00, 0x82, rnbr, (sfi << 3 | 4)) # TODO: for some reason, the commented command above DOES NOT WORK. # you need to manually add the Le parameter of the read_record command # Le. This should be investigated further but in the meantime, # let's use a work around and add it ourself manually. # Does this only happen when there is no command body? read further # about it in EMV book 3 v4.3 tmp = CommandAPDU(0x00, 0xb2, rnbr, (sfi << 3 | 4)).getBytes() tmp.append(0) command = CommandAPDU(tmp) return self.send_command(command)