I need your help in order to verify the PIN of a smart card. I am using Python
and pyscard
.
I understood that I have to use an APDU
command and that I have to send it using ScardTransmit()
but I cannot find which APDU to use. For Example:
SCardTransmit(hcard,dwActiveProtocol,
[0x00, 0x20, 0x00, 0x01, 0x06, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x00])
(so with PIN=123456) will return a mere 6A 88 - Referenced data not found
I was wondering: is there a way to get some hints about the commands to use with a particular smart card looking at its ATR
? i.e.: the command "20" in INS field (APDU is composed by CLA, INS P1, P2, DATA) is what ISO define to verify the PIN, but how to understand if I'm doing something wrong?
Thanks.
P.S.: by the way, with P2="00" I get 6A 83, record not found.