在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:AndyQ/NFCPassportReader开源软件地址:https://github.com/AndyQ/NFCPassportReader开源编程语言:Swift 100.0%开源软件介绍:NFCPassportReaderThis package handles reading an NFC Enabled passport using iOS 13 CoreNFC APIS Version 2 (and the main branch) now uses Swift Async/Await for communication. If you need an earlier version, please use 1.1.9 or below! Supported features:
This is still very early days - the code is by no means perfect and there are still some rough edges - there ARE most definitely bugs and I'm sure I'm not doing things perfectly. It reads and verifies my passport (and others I've been able to test) fine, however your mileage may vary. InstallationSwift Package Manager (recommended)NFCPassportReader may be installed via Swift Package Manager, by pointing to this repo's URL. CocoaPods (deprecated and unsupported)Install using CocoaPods by adding this line to your Podfile: use_frameworks!
pod 'NFCPassportReader', git:'https://github.com/AndyQ/NFCPassportReader.git' Then, run the following command: $ pod install Note - ** Don't use Bitcode ** - its not supported by this and has been deprecated by Apple UsageTo use, you first need to create the Passport MRZ Key which consists of the passport number, date of birth and expiry date (including the checksums). Dates are in YYMMDD format For example:
Then on an instance of PassportReader, call the readPassport method passing in the mrzKey, the datagroups to read and a completion block.
Currently the datagroups supported are: COM, DG1, DG2, DG7, DG11, DG12, DG14 (partial), DG15, and SOD This will then handle the reading of the passport, and image and will call the completion block either with an TagError error if there was an error of some kind, or nil if successful. If successful, the passportReader object will then contain valid data for the passportMRZ and passportImage fields. In addition, you can customise the messages displayed in the NFC Session Reader by providing a customDisplayMessage callback e.g. to override just the initial request to present passport message:
LoggingAdditional logging (very verbose) can be enabled on the PassportReader by passing in a log level on creation: e.g.
NOTE - currently this is just printing out to the console - I'd like to implement better logging later - probably using SwiftyBeaver PassiveAuthenticationPassive Authentication is now part of the main library and can be used to ensure that an E-Passport is valid and hasn't been tampered with. It requires a set of CSCA certificates in PEM format from a master list (either from a country that publishes their master list, or the ICAO PKD repository). See the scripts folder for details on how to get and create this file. The masterList.pem file included in the Sample app is purely there to ensure no compiler warnings and contains only a single PEM file that was self-generated and won't be able to verify anything! Sample appThere is a sample app included in the repo which demonstrates the functionality. Troubleshooting
To doThere are a number of things I'd like to implement in no particular order:
ThanksI'd like to thank the writers of pypassport (Jean-Francois Houzard and Olivier Roger - can't find their website but referenced from https://github.com/andrew867/epassportviewer) who's work this is based on. The EPassport section on YobiWiki (http://wiki.yobi.be/wiki/EPassport) This has been an invaluable resource especially around Passive Authentication. Marcin Krzyżanowski for his OpenSSL-Universal repo. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论