Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Card Access Number can be used for PACE
This is heavily inspired by #106, which I tried to rebase onto current main branch, but eventually decided to patch it by hand, because there was conflicts that I couldn't resolve in reasonable time.
As opposed to #106, there's some changes in error handling, which in our tests can detect if CAN was invalid.
We've tested the changes successfully with a couple of Finnish passports, on iOS 16.
Changes
PACEAccessKey
enum, which can either be.mrz
or.can
PassportReader.readPassport()
now usesPACEAccessKey
when establishing PACE.PassportReader.startReading()
doesn't fallback to BAC when PACE fails, if CAN was used.PassportReader.readPassport( mrzKey: ...)
as deprecated overload ofreadPassport( accessKey: ...)
. Not sure if this makes sense, because of the next bullet point...NFCPassportReaderError.InvalidMRZKey
withNFCPassportReaderError.AuthenticationFailed
, to indicate that either CAN or MRZ was incorrect.TagReader.send
, to handle authentication error when using incorrect CANCaveats
NFCPassportReaderError.InvalidMRZKey
is removedRemarks
I checked the SPM example, and it's pinned to older version of the library. Perhaps the example should be changed so that it uses local version of NFCPassportReader package, to make it easier to develop the example along with the changes to library?