AndyQ / NFCPassportReader

NFCPassportReader for iOS 13
MIT License
749 stars 242 forks source link

Error reading tag: sw1 - 0x6A, sw2 - 0x86. when scan idcard #116

Closed enaifuose closed 1 year ago

enaifuose commented 3 years ago

Hi,

first, i want to thank u for the great work you do.

i m trying to test the NFC scan in id card. but i get the following errors :

Error reading tag: sw1 - 0x6A, sw2 - 0x86 reason: Incorrect parameters P1-P2 Re-selecting eMRTD Application Starting Basic Access Control (BAC) BACHandler - deriving Document Basic Access Keys BACHandler - Getting initial challenge Error reading tag: sw1 - 0x6D, sw2 - 0x00 reason: Instruction code not supported or invalid ERROR - Instruction code not supported or invalid BAC Failed

Any help please.

danydev commented 3 years ago

When reporting issues it's kind of useful to specify type (id card, passport, etc..) and country of the document you are using

shakhzodiosdev commented 2 years ago

The same issue while reading driving license. Have you solved?

shakhzodiosdev commented 2 years ago

@enaifuose Any solutions?

RobinFarmer commented 2 years ago

Ran into the same problem using a Latvian ID card.

@shakhzodiosdev did you happen to find a solution for this?

shakhzodiosdev commented 2 years ago

As I remember you should try to add ISO7816 application identifiers for NFC Tag Reader Session in your plist :

image

Here is the list of identifiers : D3921000310001010408 D3921000310001010100 00A4040C07A0000002471001 D3921000310001010401 D392F000260100000001 A0000002310100000000000000000000 A0000002310200000000000000000000 A0000002480300000000000000000000 A0000002471001 D2760000850101 A000000151000000 00000000000000

your plist should look like that ) I am not sure that it will help you but anyway you can try )

RobinFarmer commented 2 years ago

Thanks just tried it but unfortunately the problem remains.

I did already have the the following:

A0000002471001
A0000002472001

I added the ones you said but yea same problem.

Do you remember where you find those identifiers? @shakhzodiosdev

shakhzodiosdev commented 2 years ago

@RobinFarmer These identifiers I found from different sources) I am sure that some of them I do not need also) I just tried to add each identifier that I could find while searching.

shakhzodiosdev commented 2 years ago

@RobinFarmer I am sorry earlier I had said the same problem with driving license. Actually I could not solve the issue with driving license and as I remember I had not problem with reading from ID card.

RobinFarmer commented 2 years ago

@shakhzodiosdev Thanks,

I did find https://www.eftlab.com/knowledge-base/211-emv-aid-rid-pix/ which has lots of identifiers including:

Screenshot 2022-08-04 at 15 22 20

I can't it to work yet but will continue to look into it.

AndyQ commented 1 year ago

I'm closing this as whilst ID cards may work, its not something I can test as I don' have access to any.

If you are able to to get more information, please submit a PR or a new issue with more details