I am trying to read a smartcard(German Gesundheitskarte) using javax.smartcardio
In the definition of the EF \"PD\" its length is specified as 850 bytes. The conten
I tried the above exemple to read the DG2 file of a passport, but at the end, i was unable to get the image file. here is what i did in kotlin:
do {
val offsetStart = (offset shr 8) and 0xFF
val offsetEnd = offset and 0xFF
LogUtils.d(offsetStart)
LogUtils.d(offsetEnd)
var offsetStartString = if(offsetStart < 10){
"0$offsetStart"
}else {
"$offsetStart"
}
val offsetEndString = if(offsetEnd < 10){
"0$offsetEnd"
}else {
"$offsetEnd"
}
LogUtils.d(offsetStartString)
LogUtils.d("00B0${offsetStartString}${offsetEndString}00")
val commandByte = toByteArray("00B0${offsetStartString}${offsetEndString}00")
resultCommand = this.nfc.transmit(commandByte,commandByte.size)
val resultHex = StringUtil.toHexString(resultCommand)
LogUtils.d(resultHex)
baos.write(resultCommand)
offset += 1
LogUtils.d(resultCommand.size)
} while (resultCommand.size > 4)