AndyQ / NFCPassportReader

NFCPassportReader for iOS 13
MIT License
727 stars 231 forks source link

Unable to read Belarusian Id Card with BAC. #190

Closed ivanguk10 closed 10 months ago

ivanguk10 commented 10 months ago

I did passportReader.readPassport(mrzKey: key, skipCA: true, skipPACE: true) and I received 2023-08-25 14:48:56.9410 - Starting Basic Access Control (BAC) 2023-08-25 14:48:56.9410 - BACHandler - deriving Document Basic Access Keys 2023-08-25 14:48:56.9430 - BACHandler - Getting initial challenge 2023-08-25 14:48:56.9530 - BACHandler - Doing mutual authentication 2023-08-25 14:48:56.9670 - DATA - [] Alert message tells me that mrz key is wrong. But I'm sure that it is correct. I did the same things on android side with the jmrtd. And everything was okay. Thank you for your attention!

ivanguk10 commented 10 months ago

If I do passportReader.readPassport(mrzKey: key, skipCA: true) I get such logs 2023-08-25 14:54:52.7610 - Error reading tag: sw1 - 0x6A, sw2 - 0x86 2023-08-25 14:54:52.7620 - reason: Incorrect parameters P1-P2 2023-08-25 14:54:52.7620 - PACE Failed - falling back to BAC 2023-08-25 14:54:52.7620 - Re-selecting eMRTD Application 2023-08-25 14:54:52.7720 - Error reading tag: sw1 - 0x6A, sw2 - 0x88 2023-08-25 14:54:52.7730 - reason: Referenced data not found

ivanguk10 commented 10 months ago

It was problem on my side. Don't forget to add all ISO7816 application identifiers for NFC Tag Reader Session for all applets that you need. Thanks for the library!