ZeroPass / dmrtd

Dart library for reading Biometric Passport
Other
67 stars 34 forks source link

Can't Read VietNam IDCard #28

Open ngocminh1805 opened 6 months ago

ngocminh1805 commented 6 months ago

I try use this app to read VietNam IDCard but it notworking Screenshot 2024-05-29 at 15 04 22

smlu commented 6 months ago

Fyi library only supports biometric passport standard ICAO 9303 aka MRTD. Your ID card has to support this standar in order to read it with this library.

ngocminh1805 commented 6 months ago

Fyi library only supports biometric passport standard ICAO 9303 aka MRTD. Your ID card has to support this standar in order to read it with this library.

VietNam IDcard have ICAO 9303 but this app can't not read it

smlu commented 6 months ago

From provided screenshot I can only guess that your card doesn't support selecting master file. What you can try is comment out these 2 lines: https://github.com/ZeroPass/dmrtd/blob/a9766109b30ca26a081c7079b508ee271727313b/lib/src/passport.dart#L409-L410

ngocminh1805 commented 6 months ago

From provided screenshot I can only guess that your card doesn't support selecting master file. What you can try is comment out these 2 lines:

https://github.com/ZeroPass/dmrtd/blob/a9766109b30ca26a081c7079b508ee271727313b/lib/src/passport.dart#L409-L410

I try that but it still not working. VietNam IdCard have ISO/IEC 7816 and ICAO 9303

smlu commented 6 months ago

Might be related to this: https://github.com/AndyQ/NFCPassportReader/issues/219 If you're trying to read ID with iPhone iOS >= 16 it might be related to this issue: https://github.com/AndyQ/NFCPassportReader/issues/164#issuecomment-2139300643

ngocminh1805 commented 6 months ago

Might be related to this: AndyQ/NFCPassportReader#219 If you're trying to read ID with iPhone iOS >= 16 it might be related to this issue: AndyQ/NFCPassportReader#164 (comment)

i do it on android. i think access card apdu command is different. i try send 00a4020c02011c and it response 9000, but your app send 00a40000 response 6a86.

smlu commented 6 months ago

... but your app send 00a40000 response 6a86.

Yes, this should be one of the valid SELECT FILE commands for selecting the master file. From your log, you can see there are other master file selection commands being sent prior to the final error. This happens here: https://github.com/ZeroPass/dmrtd/blob/be55ab5bef7830ec315d6132ac0f66a5c4cbe423/lib/src/proto/mrtd_api.dart#L111-L124 It looks like your card either doesn't support any of these commands, or if the master file is already selected (android), the card sends the wrong status word (SW) for the file being already selected.

... i try send 00a4020c02011c and it response 9000 ...

You are trying to select EF.CardAcces here, right?
What happens if you send redFileBySFI instead? https://github.com/ZeroPass/dmrtd/blob/a9766109b30ca26a081c7079b508ee271727313b/lib/src/passport.dart#L104