diff --git a/MoppApp/MoppApp.xcodeproj/project.pbxproj b/MoppApp/MoppApp.xcodeproj/project.pbxproj index 71a8a45a2..26ed1b0e0 100644 --- a/MoppApp/MoppApp.xcodeproj/project.pbxproj +++ b/MoppApp/MoppApp.xcodeproj/project.pbxproj @@ -30,6 +30,9 @@ 4E59080024B0F914001B23A6 /* SmartIDEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E5907FF24B0F914001B23A6 /* SmartIDEditViewController.swift */; }; 4E59080224B258C7001B23A6 /* SmartIDChallengeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E59080124B258C6001B23A6 /* SmartIDChallengeViewController.swift */; }; 4E59080424B2E295001B23A6 /* SmartIDSignature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E59080324B2E295001B23A6 /* SmartIDSignature.swift */; }; + 4E6E1D9B2AAB493A008B3E74 /* NFCEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E6E1D9A2AAB493A008B3E74 /* NFCEditViewController.swift */; }; + 4EE56D232AB0561C002648EE /* NFCSignature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE56D222AB0561C002648EE /* NFCSignature.swift */; }; + 4EE56D272AB058A6002648EE /* SwiftECC in Frameworks */ = {isa = PBXBuildFile; productRef = 4EE56D262AB058A6002648EE /* SwiftECC */; }; 540786E91E1A76640016ABA7 /* UITextView+Additions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 540786E81E1A76640016ABA7 /* UITextView+Additions.swift */; }; 547BDF251E8BEFA30093931F /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = E4250D0D1E0AA8E500530370 /* Localizable.strings */; }; 54825EF51E1CFE9600253FF0 /* Date+Additions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54825EF41E1CFE9600253FF0 /* Date+Additions.swift */; }; @@ -370,6 +373,8 @@ 4E5907FF24B0F914001B23A6 /* SmartIDEditViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SmartIDEditViewController.swift; sourceTree = ""; }; 4E59080124B258C6001B23A6 /* SmartIDChallengeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SmartIDChallengeViewController.swift; sourceTree = ""; }; 4E59080324B2E295001B23A6 /* SmartIDSignature.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SmartIDSignature.swift; sourceTree = ""; }; + 4E6E1D9A2AAB493A008B3E74 /* NFCEditViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NFCEditViewController.swift; sourceTree = ""; }; + 4EE56D222AB0561C002648EE /* NFCSignature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFCSignature.swift; sourceTree = ""; }; 540786E81E1A76640016ABA7 /* UITextView+Additions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITextView+Additions.swift"; sourceTree = ""; }; 54825EF41E1CFE9600253FF0 /* Date+Additions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Date+Additions.swift"; sourceTree = ""; }; 54825EF71E1D270F00253FF0 /* String+Additions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Additions.swift"; sourceTree = ""; }; @@ -644,6 +649,7 @@ 393B66E820DB9C19001DC89B /* CryptoLib.framework in Frameworks */, DF135630290201A100F61823 /* ExternalAccessory.framework in Frameworks */, DF1503AB2AC5D1E5007222B2 /* ZIPFoundation in Frameworks */, + 4EE56D272AB058A6002648EE /* SwiftECC in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -677,6 +683,7 @@ C54EA6E72045A9E30039AC78 /* IdCardViewController.swift */, C54BB10E1FBD93A100A274F6 /* MobileIDChallengeViewController.swift */, C537AE532004C29E009037E5 /* MobileIDEditViewController.swift */, + 4E6E1D9A2AAB493A008B3E74 /* NFCEditViewController.swift */, 4E59080124B258C6001B23A6 /* SmartIDChallengeViewController.swift */, 4E5907FF24B0F914001B23A6 /* SmartIDEditViewController.swift */, C50DCD1A1FD1576B00D48E16 /* SigningTableViewHeaderView.swift */, @@ -734,8 +741,7 @@ children = ( C50DCCD01FC573FB00D48E16 /* Roboto */, ); - name = Fonts; - path = "New Group"; + path = Fonts; sourceTree = ""; }; C50DCCD01FC573FB00D48E16 /* Roboto */ = { @@ -1202,6 +1208,7 @@ DFDF02C3241ED0CA006CF443 /* MobileIDSignature.swift */, 4E59080324B2E295001B23A6 /* SmartIDSignature.swift */, DFBDF20127DF7ED700A5CF3C /* IDCardSignature.swift */, + 4EE56D222AB0561C002648EE /* NFCSignature.swift */, DFDF02BD241EB5D3006CF443 /* SessionCertificate.swift */, E4C53F4D1E30D13100F209BE /* Session.swift */, DFDF02BF241EC72C006CF443 /* SessionStatus.swift */, @@ -1296,6 +1303,7 @@ DF1503A52AC5D1B9007222B2 /* FirebaseCrashlytics */, DF1503A72AC5D1DB007222B2 /* SwiftyRSA */, DF1503AA2AC5D1E5007222B2 /* ZIPFoundation */, + 4EE56D262AB058A6002648EE /* SwiftECC */, ); productName = MoppApp; productReference = E4250CC31E0968D200530370 /* MoppApp.app */; @@ -1348,6 +1356,7 @@ DF15037C2AC5CD32007222B2 /* XCRemoteSwiftPackageReference "SwiftyRSA" */, DF15037F2AC5CD8D007222B2 /* XCRemoteSwiftPackageReference "ZIPFoundation" */, DF1503822AC5CDBC007222B2 /* XCRemoteSwiftPackageReference "ASN1Decoder" */, + 4EE56D252AB058A6002648EE /* XCRemoteSwiftPackageReference "SwiftECC" */, ); productRefGroup = E4250CC41E0968D200530370 /* Products */; projectDirPath = ""; @@ -1607,6 +1616,7 @@ C50DCD461FDECE2B00D48E16 /* SignatureDetailsViewController.swift in Sources */, DF5BE6D429C8BD5600331609 /* WarningDetail.swift in Sources */, DF32A6812909F0FA00AE5F82 /* FileLogUtil.swift in Sources */, + 4EE56D232AB0561C002648EE /* NFCSignature.swift in Sources */, C50DCCFF1FC6E95A00D48E16 /* ContainerViewController.swift in Sources */, C50DCD481FDED76400D48E16 /* SignatureDetailsCell.swift in Sources */, DF0C2B3F29150EAB007E1745 /* ScaledLabel.swift in Sources */, @@ -1680,6 +1690,7 @@ C506EC811FB9F4AF00E07226 /* UIImage+Additions.swift in Sources */, C55A6E42208766BA000F3386 /* MyeIDChangeCodesLoadingViewController.swift in Sources */, DFDC0ABA29FAD8F2002D1D1D /* ViewUtil.swift in Sources */, + 4E6E1D9B2AAB493A008B3E74 /* NFCEditViewController.swift in Sources */, DFD8BEF5291C432400FE8F07 /* ScaledButton.swift in Sources */, C5927FC720751402003B7F41 /* MyeIDPinPukCell.swift in Sources */, DFF3C3AF233231190079458A /* SettingsConfiguration.swift in Sources */, @@ -2125,6 +2136,14 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ + 4EE56D252AB058A6002648EE /* XCRemoteSwiftPackageReference "SwiftECC" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/leif-ibsen/SwiftECC"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 4.0.0; + }; + }; DF1503792AC5CCE7007222B2 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git"; @@ -2160,6 +2179,11 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 4EE56D262AB058A6002648EE /* SwiftECC */ = { + isa = XCSwiftPackageProductDependency; + package = 4EE56D252AB058A6002648EE /* XCRemoteSwiftPackageReference "SwiftECC" */; + productName = SwiftECC; + }; DF1503A32AC5D163007222B2 /* ASN1Decoder */ = { isa = XCSwiftPackageProductDependency; package = DF1503822AC5CDBC007222B2 /* XCRemoteSwiftPackageReference "ASN1Decoder" */; diff --git a/MoppApp/MoppApp/AlertUtil.swift b/MoppApp/MoppApp/AlertUtil.swift index 9457a3f26..b29fad54d 100644 --- a/MoppApp/MoppApp/AlertUtil.swift +++ b/MoppApp/MoppApp/AlertUtil.swift @@ -63,6 +63,8 @@ class AlertUtil { case .cancelled: topViewController.dismiss(animated: true) return + case .nfcCancelled: + return default: break } @@ -71,6 +73,8 @@ class AlertUtil { case .cancelled: topViewController.dismiss(animated: true) return + case .nfcCancelled: + return default: break } diff --git a/MoppApp/MoppApp/CancelUtil.swift b/MoppApp/MoppApp/CancelUtil.swift index 9d35acbf5..a3c8592b9 100644 --- a/MoppApp/MoppApp/CancelUtil.swift +++ b/MoppApp/MoppApp/CancelUtil.swift @@ -28,6 +28,6 @@ class CancelUtil { static func handleCancelledRequest(errorMessageDetails: String) { CancelRequestUtil.handleRequestCancellation() - ErrorUtil.generateError(signingError: .cancelled, details: MessageUtil.errorMessageWithDetails(details: errorMessageDetails)) + ErrorUtil.generateError(signingError: .nfcCancelled, details: MessageUtil.errorMessageWithDetails(details: errorMessageDetails)) } } diff --git a/MoppApp/MoppApp/Info.plist b/MoppApp/MoppApp/Info.plist index 6521e28f8..1e8a35295 100644 --- a/MoppApp/MoppApp/Info.plist +++ b/MoppApp/MoppApp/Info.plist @@ -219,6 +219,8 @@ LSSupportsOpeningDocumentsInPlace + NFCReaderUsageDescription + This app uses NFC to scan ID-cards NSAppTransportSecurity NSExceptionDomains @@ -1020,5 +1022,9 @@ + com.apple.developer.nfc.readersession.iso7816.select-identifiers + + A000000077010800070000FE000001 + diff --git a/MoppApp/MoppApp/KeychainUtil.swift b/MoppApp/MoppApp/KeychainUtil.swift index b8c86186c..2e9990799 100644 --- a/MoppApp/MoppApp/KeychainUtil.swift +++ b/MoppApp/MoppApp/KeychainUtil.swift @@ -28,52 +28,52 @@ class KeychainUtil { static func save(key: String, info: String) -> Bool { guard let bundleIdentifier = Bundle.main.bundleIdentifier else { return false } if let data = info.data(using: .utf8) { - let query: [String: Any] = [ - kSecClass as String: kSecClassGenericPassword, - kSecAttrService as String: bundleIdentifier, - kSecAttrAccount as String: "\(bundleIdentifier).\(key)", - kSecValueData as String: data, - kSecAttrAccessible as String: kSecAttrAccessibleWhenUnlockedThisDeviceOnly + let query: [CFString: Any] = [ + kSecClass: kSecClassGenericPassword, + kSecAttrService: bundleIdentifier, + kSecAttrAccount: "\(bundleIdentifier).\(key)", + kSecValueData: data, + kSecAttrAccessible: kSecAttrAccessibleWhenUnlockedThisDeviceOnly ] SecItemDelete(query as CFDictionary) let status = SecItemAdd(query as CFDictionary, nil) - + return status == errSecSuccess } return false } - + static func retrieve(key: String) -> String? { guard let bundleIdentifier = Bundle.main.bundleIdentifier else { return nil } - let query: [String: Any] = [ - kSecClass as String: kSecClassGenericPassword, - kSecAttrService as String: bundleIdentifier, - kSecAttrAccount as String: "\(bundleIdentifier).\(key)", - kSecReturnData as String: true, - kSecMatchLimit as String: kSecMatchLimitOne, - kSecAttrAccessible as String: kSecAttrAccessibleWhenUnlockedThisDeviceOnly + let query: [CFString: Any] = [ + kSecClass: kSecClassGenericPassword, + kSecAttrService: bundleIdentifier, + kSecAttrAccount: "\(bundleIdentifier).\(key)", + kSecReturnData: true, + kSecMatchLimit: kSecMatchLimitOne, + kSecAttrAccessible: kSecAttrAccessibleWhenUnlockedThisDeviceOnly ] - + var infoData: AnyObject? let status = SecItemCopyMatching(query as CFDictionary, &infoData) - + if status == errSecSuccess, let data = infoData as? Data { return String(data: data, encoding: .utf8) } else { return nil } } - + static func remove(key: String) { guard let bundleIdentifier = Bundle.main.bundleIdentifier else { return } - let query: [String: Any] = [ - kSecClass as String: kSecClassGenericPassword, - kSecAttrService as String: bundleIdentifier, - kSecAttrAccount as String: "\(bundleIdentifier).\(key)" + let query: [CFString: Any] = [ + kSecClass: kSecClassGenericPassword, + kSecAttrService: bundleIdentifier, + kSecAttrAccount: "\(bundleIdentifier).\(key)" ] - + let status = SecItemDelete(query as CFDictionary) - + if status != errSecSuccess { printLog("Error removing key from Keychain: \(status)") } diff --git a/MoppApp/MoppApp/LocalizationKeys.swift b/MoppApp/MoppApp/LocalizationKeys.swift index 2f726f944..326475fee 100644 --- a/MoppApp/MoppApp/LocalizationKeys.swift +++ b/MoppApp/MoppApp/LocalizationKeys.swift @@ -166,6 +166,21 @@ enum LocKey : String case smartIdCountryLithuania = "smart-id-country-lithuania" case smartIdCountryLatvia = "smart-id-country-latvia" case smartIdChallengeTitle = "smart-id-challenge-title" + case nfcTitle = "nfc-title" + case nfcCANTitle = "nfc-can-title" + case nfcDeviceNoSupport = "nfc-device-no-support" + case nfcHoldNear = "nfc-hold-near" + case nfcMultipleCards = "nfc-multiple-cards" + case nfcInvalidTag = "nfc-invalid-tag" + case nfcUnableConnect = "nfc-unable-connect" + case nfcAuth = "nfc-auth" + case nfcReadingCert = "nfc-reading-cert" + case nfcSignDoc = "nfc-sign-doc" + case nfcSignDone = "nfc-sign-done" + case nfcAuthFailed = "nfc-auth-failed" + case nfcSignFailed = "nfc-sign-failed" + case nfcPinInvalid = "nfc-pin-invalid" + case nfcPinLocked = "nfc-pin-locked" case containerSignTitle = "container-sign-title" case containerEncryptionTitle = "container-encryption-title" case containerDecryptionTitle = "container-decryption-title" @@ -190,6 +205,7 @@ enum LocKey : String case signTitleMobileId = "sign-title-mobile-id" case signTitleSmartId = "sign-title-smart-id" case signTitleIdCard = "sign-title-id-card" + case signTitleNFC = "sign-title-nfc" case cardReaderStateReaderNotFound = "card-reader-state-reader-not-found" case cardReaderStateReaderRestarted = "card-reader-state-reader-restarted" case cardReaderStateReaderProcessFailed = "card-reader-state-reader-process-failed" diff --git a/MoppApp/MoppApp/MoppApp.entitlements b/MoppApp/MoppApp/MoppApp.entitlements index 35496166c..a713e19e8 100644 --- a/MoppApp/MoppApp/MoppApp.entitlements +++ b/MoppApp/MoppApp/MoppApp.entitlements @@ -2,6 +2,10 @@ + com.apple.developer.nfc.readersession.formats + + TAG + com.apple.security.application-groups group.ee.ria.digidoc.ios diff --git a/MoppApp/MoppApp/MyEid.storyboard b/MoppApp/MoppApp/MyEid.storyboard index 6574cc879..173185ebf 100644 --- a/MoppApp/MoppApp/MyEid.storyboard +++ b/MoppApp/MoppApp/MyEid.storyboard @@ -1,9 +1,9 @@ - + - + @@ -72,11 +72,11 @@ - - + + - @@ -161,6 +173,7 @@ + @@ -174,6 +187,7 @@ + @@ -274,16 +288,16 @@ - + - + @@ -347,7 +361,7 @@ - + @@ -855,16 +869,16 @@ - + - + @@ -911,7 +925,7 @@ - + @@ -1388,6 +1402,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MoppApp/MoppApp/TokenFlowSelectionViewController.swift b/MoppApp/MoppApp/TokenFlowSelectionViewController.swift index 99de52877..f57eea0a4 100644 --- a/MoppApp/MoppApp/TokenFlowSelectionViewController.swift +++ b/MoppApp/MoppApp/TokenFlowSelectionViewController.swift @@ -36,7 +36,8 @@ class TokenFlowSelectionViewController : MoppViewController { @IBOutlet weak var mobileIDButton: ScaledButton! @IBOutlet weak var smartIDButton: ScaledButton! @IBOutlet weak var idCardButton: ScaledButton! - + @IBOutlet weak var nfcButton: ScaledButton! + @IBOutlet weak var tokenViewContainerTopConstraint: NSLayoutConstraint! @IBOutlet weak var tokenFlowViewLeadingCSTR: NSLayoutConstraint! @IBOutlet weak var tokenFlowViewTrailingCSTR: NSLayoutConstraint! @@ -51,7 +52,8 @@ class TokenFlowSelectionViewController : MoppViewController { weak var smartIdEditViewControllerDelegate: SmartIDEditViewControllerDelegate! weak var idCardSignViewControllerDelegate: IdCardSignViewControllerDelegate? weak var idCardDecryptViewControllerDelegate: IdCardDecryptViewControllerDelegate? - + weak var nfcEditViewControllerDelegate: NFCEditViewControllerDelegate! + var containerPath: String! var isSwitchingBlockedByTransition: Bool = false @@ -71,6 +73,7 @@ class TokenFlowSelectionViewController : MoppViewController { case mobileID case smartID case idCard + case nfc } override func viewDidLoad() { @@ -127,19 +130,24 @@ class TokenFlowSelectionViewController : MoppViewController { switch id { case .idCard: $0.setTitle(L(.signTitleIdCard)) - idCardButton.accessibilityLabel = setTabAccessibilityLabel(isTabSelected: false, tabName: L(.signTitleIdCard), positionInRow: "3", viewCount: "3") + idCardButton.accessibilityLabel = setTabAccessibilityLabel(isTabSelected: false, tabName: L(.signTitleIdCard), positionInRow: "3", viewCount: "4") idCardButton.accessibilityUserInputLabels = [L(.voiceControlIdCard)] idCardButton.adjustedFont() case .mobileID: $0.setTitle(L(.signTitleMobileId)) - mobileIDButton.accessibilityLabel = setTabAccessibilityLabel(isTabSelected: false, tabName: L(.signTitleMobileId), positionInRow: "1", viewCount: "3") + mobileIDButton.accessibilityLabel = setTabAccessibilityLabel(isTabSelected: false, tabName: L(.signTitleMobileId), positionInRow: "1", viewCount: "4") mobileIDButton.accessibilityUserInputLabels = [L(.voiceControlMobileId)] mobileIDButton.adjustedFont() case .smartID: $0.setTitle(L(.signTitleSmartId)) - smartIDButton.accessibilityLabel = setTabAccessibilityLabel(isTabSelected: false, tabName: L(.signTitleSmartId), positionInRow: "2", viewCount: "3") + smartIDButton.accessibilityLabel = setTabAccessibilityLabel(isTabSelected: false, tabName: L(.signTitleSmartId), positionInRow: "2", viewCount: "4") smartIDButton.accessibilityUserInputLabels = [L(.voiceControlSmartId)] smartIDButton.adjustedFont() + case .nfc: + $0.setTitle(L(.signTitleNFC)) + nfcButton.accessibilityLabel = setTabAccessibilityLabel(isTabSelected: false, tabName: L(.signTitleNFC), positionInRow: "4", viewCount: "4") + nfcButton.accessibilityUserInputLabels = [L(.signTitleNFC)] + nfcButton.adjustedFont() } } } @@ -191,19 +199,25 @@ extension TokenFlowSelectionViewController { } idCardSignVC.keyboardDelegate = self newViewController = idCardSignVC - viewAccessibilityElements = [idCardButton, containerView, mobileIDButton, smartIDButton, containerView] + viewAccessibilityElements = [idCardButton, containerView, mobileIDButton, smartIDButton, nfcButton, containerView] + case .nfc: + let nfcSignVC = UIStoryboard.tokenFlow.instantiateViewController(of: NFCEditViewController.self) + centerLandscapeCSTR.isActive = false + nfcSignVC.delegate = nfcEditViewControllerDelegate + newViewController = nfcSignVC + viewAccessibilityElements = [nfcButton, containerView, idCardButton, mobileIDButton, smartIDButton, containerView] case .mobileID: let mobileIdEditVC = UIStoryboard.tokenFlow.instantiateViewController(of: MobileIDEditViewController.self) handleConstraintInLandscape() mobileIdEditVC.delegate = mobileIdEditViewControllerDelegate newViewController = mobileIdEditVC - viewAccessibilityElements = [mobileIDButton, containerView, smartIDButton, idCardButton, containerView] + viewAccessibilityElements = [mobileIDButton, containerView, smartIDButton, idCardButton, nfcButton, containerView] case .smartID: let smartIdEditVC = UIStoryboard.tokenFlow.instantiateViewController(of: SmartIDEditViewController.self) handleConstraintInLandscape() smartIdEditVC.delegate = smartIdEditViewControllerDelegate newViewController = smartIdEditVC - viewAccessibilityElements = [smartIDButton, containerView, idCardButton, mobileIDButton, smartIDButton, containerView] + viewAccessibilityElements = [smartIDButton, containerView, idCardButton, mobileIDButton, smartIDButton, nfcButton, containerView] } if UIAccessibility.isVoiceOverRunning { diff --git a/MoppApp/MoppApp/en.lproj/Localizable.strings b/MoppApp/MoppApp/en.lproj/Localizable.strings index e350c876d..5f7f3d9e8 100755 --- a/MoppApp/MoppApp/en.lproj/Localizable.strings +++ b/MoppApp/MoppApp/en.lproj/Localizable.strings @@ -230,6 +230,20 @@ "smart-id-country-latvia" = "Latvia"; "smart-id-challenge-title" = "Sign with Smart-ID"; "smart-id-sign-help-title" = "Make sure control code matches with one in phone screen and enter Smart-ID PIN2 code"; +"nfc-title" = "Enter your ID-card access number and PIN2 code to sign with ID-card"; +"nfc-can-title" = "ID-card access number"; +"nfc-device-no-support" = "This device does not support NFC."; +"nfc-hold-near" = "Hold your phone near the ID-card"; +"nfc-multiple-cards" = "More than 1 NFC tag is detected, please remove all NFC tags and try again"; +"nfc-invalid-tag" = "Invalid NFC tag"; +"nfc-unable-connect" = "Unable to connect to NFC tag"; +"nfc-auth" = "Authenticating with ID-card"; +"nfc-reading-cert" = "Reading certificate"; +"nfc-sign-doc" = "Signing document"; +"nfc-sign-done" = "Signing done"; +"nfc-auth-failed" = "Failed to authenticate with ID-card"; +"nfc-sign-failed" = "Failed to sign document with ID-card"; +"nfc-pin-locked" = "Locked PIN"; "role-and-address" = "Role and address"; "role-and-address-title" = "Enter your role and address info"; "role-and-address-role-title" = "Role / resolution"; @@ -253,6 +267,7 @@ "sign-title-mobile-id" = "Mobile-ID"; "sign-title-smart-id" = "Smart-ID"; "sign-title-id-card" = "ID-Card"; +"sign-title-nfc" = "NFC"; "card-reader-state-initial" = "Connect the card reader and insert your ID-card into the reader."; "card-reader-state-reader-not-found" = "No card readers found"; "card-reader-state-reader-restarted" = "Restarting card reader."; diff --git a/MoppApp/MoppApp/et.lproj/Localizable.strings b/MoppApp/MoppApp/et.lproj/Localizable.strings index 36bea1ccd..35909f697 100755 --- a/MoppApp/MoppApp/et.lproj/Localizable.strings +++ b/MoppApp/MoppApp/et.lproj/Localizable.strings @@ -231,6 +231,20 @@ "smart-id-country-latvia" = "Läti"; "smart-id-challenge-title" = "Allkirjasta Smart-IDga"; "smart-id-sign-help-title" = "Veendu kontrollkoodi õigsuses ja sisesta nutiseadmes Smart-ID PIN2-kood"; +"nfc-title" = "ID-kaardiga allkirjastamiseks sisesta oma ID-kaardi ligipääsu number ja PIN2-kood"; +"nfc-can-title" = "ID-kaardi ligipääsu number"; +"nfc-device-no-support" = "See seade ei toeta NFC-d"; +"nfc-hold-near" = "Hoidke ID-kaarti telefoni lähedal"; +"nfc-multiple-cards" = "Rohkem kui 1 NFC märgis on tuvastatud, eemaldage kõik NFC-märgisega esemed ja proovige uuesti"; +"nfc-invalid-tag" = "Kehtetu NFC-märgis"; +"nfc-unable-connect" = "NFC-ega ei saa ühendust luua"; +"nfc-auth" = "Isikutuvastus ID-kaardiga"; +"nfc-reading-cert" = "Sertifikaadi lugemine"; +"nfc-sign-doc" = "Allkirjasta dokument"; +"nfc-sign-done" = "Allkiri lisatud"; +"nfc-auth-failed" = "Isikutuvastus ID-kaardiga ebaõnnestus"; +"nfc-sign-failed" = "Failed to sign document with ID-card"; +"nfc-pin-locked" = "Locked PIN"; "role-and-address" = "Roll ja aadress"; "role-and-address-title" = "Sisesta oma roll ja aadress"; "role-and-address-role-title" = "Roll / resolutsioon"; @@ -254,6 +268,7 @@ "sign-title-mobile-id" = "Mobiil-ID"; "sign-title-smart-id" = "Smart-ID"; "sign-title-id-card" = "ID-kaart"; +"sign-title-nfc" = "NFC"; "card-reader-state-reader-not-found" = "Ühtegi kaardilugejat pole ühendatud"; "card-reader-state-reader-restarted" = "Taaskäivitan kaardilugeja."; "card-reader-state-reader-process-failed" = "Andmete lugemine ebaõnnestus. Palun taasühenda kaardilugeja ja proovi uuesti."; diff --git a/MoppApp/MoppApp/ru.lproj/Localizable.strings b/MoppApp/MoppApp/ru.lproj/Localizable.strings index bc2f43506..c193f9761 100644 --- a/MoppApp/MoppApp/ru.lproj/Localizable.strings +++ b/MoppApp/MoppApp/ru.lproj/Localizable.strings @@ -231,6 +231,20 @@ "smart-id-country-latvia" = "Латвия"; "smart-id-challenge-title" = "Подписать с помощью приложения Smart-ID"; "smart-id-sign-help-title" = "Убедитесь в правильности контрольного кода и введите PIN2-код для Smart-ID"; +"nfc-title" = "Введите номер доступа к карте и PIN2-код для подписи с помощью ID-карты"; +"nfc-can-title" = "Номер доступа к карте"; +"nfc-device-no-support" = "Это устройство не поддерживает NFC"; +"nfc-hold-near" = "Держите телефон рядом с ID-картой"; +"nfc-multiple-cards" = "Обнаружено более одной NFC-метки, пожалуйста, удалите все NFC-метки и повторите попытку"; +"nfc-invalid-tag" = "Недействительная NFC-метка"; +"nfc-unable-connect" = "Невозможно подключиться к NFC-метке"; +"nfc-auth" = "Идентификация личности по карте"; +"nfc-reading-cert" = "Считывание сертификата"; +"nfc-sign-doc" = "Подписать документ"; +"nfc-sign-done" = "Подпись добавлена"; +"nfc-auth-failed" = "Идентификация личности по карте не удалась"; +"nfc-sign-failed" = "Failed to sign document with ID-card"; +"nfc-pin-locked" = "Locked PIN"; "role-and-address" = "Роль и адрес"; "role-and-address-title" = "Введите свою роль и адрес"; "role-and-address-role-title" = "Роль / pезолюция"; @@ -254,6 +268,7 @@ "sign-title-mobile-id" = "Mobiil-ID"; "sign-title-smart-id" = "Smart-ID"; "sign-title-id-card" = "ID-карта"; +"sign-title-nfc" = "NFC"; "card-reader-state-initial" = "Подключите считыватель карты и вставьте в него Вашу ID-карту."; "card-reader-state-reader-not-found" = "Считыватель карты не обнаружен"; "card-reader-state-reader-restarted" = "Перезапуск устройства чтения карт."; diff --git a/SkSigningLib/SkSigningLib/Models/SigningError.swift b/SkSigningLib/SkSigningLib/Models/SigningError.swift index 7c0872b4f..b3a0e0bd7 100644 --- a/SkSigningLib/SkSigningLib/Models/SigningError.swift +++ b/SkSigningLib/SkSigningLib/Models/SigningError.swift @@ -26,7 +26,7 @@ import Foundation public enum SigningError: Error, Equatable { // MARK: General - case empty, cancelled + case empty, cancelled, nfcCancelled // MARK: General Errors case invalidURL, noResponseError, generalError, generalSignatureAddingError, invalidSSLCert @@ -55,6 +55,8 @@ public enum SigningError: Error, Equatable { self = .empty case "cancelled": self = .cancelled + case "nfcCancelled": + self = .nfcCancelled case "invalidURL": self = .invalidURL case "noResponseError": @@ -146,6 +148,8 @@ extension SigningError: LocalizedError { return NSLocalizedString("", comment: "") case .cancelled: return NSLocalizedString("Signing cancelled", comment: "") + case .nfcCancelled: + return NSLocalizedString("NFC signing cancelled", comment: "") case .parameterNameNull: return NSLocalizedString("mid-rest-error-incorrect-parameters", comment: "") case .invalidURL: diff --git a/SkSigningLib/SkSigningLib/Models/SigningType.swift b/SkSigningLib/SkSigningLib/Models/SigningType.swift index 9dcbcafe2..7502a5c75 100644 --- a/SkSigningLib/SkSigningLib/Models/SigningType.swift +++ b/SkSigningLib/SkSigningLib/Models/SigningType.swift @@ -27,4 +27,5 @@ public enum SigningType: String { case mobileId case smartId case idCard + case nfc }