diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..83296ca --- /dev/null +++ b/.gitignore @@ -0,0 +1,220 @@ +######################### +# .gitignore file for Xcode4 and Xcode5 Source projects +# +# Apple bugs, waiting for Apple to fix/respond: +# +# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? +# +# Version 2.6 +# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects +# +# 2015 updates: +# - Fixed typo in "xccheckout" line - thanks to @lyck for pointing it out! +# - Fixed the .idea optional ignore. Thanks to @hashier for pointing this out +# - Finally added "xccheckout" to the ignore. Apple still refuses to answer support requests about this, but in practice it seems you should ignore it. +# - minor tweaks from Jona and Coeur (slightly more precise xc* filtering/names) +# 2014 updates: +# - appended non-standard items DISABLED by default (uncomment if you use those tools) +# - removed the edit that an SO.com moderator made without bothering to ask me +# - researched CocoaPods .lock more carefully, thanks to Gokhan Celiker +# 2013 updates: +# - fixed the broken "save personal Schemes" +# - added line-by-line explanations for EVERYTHING (some were missing) +# +# NB: if you are storing "built" products, this WILL NOT WORK, +# and you should use a different .gitignore (or none at all) +# This file is for SOURCE projects, where there are many extra +# files that we want to exclude +# +######################### + +##### +# OS X temporary files that should never be committed +# +# c.f. http://www.westwind.com/reference/os-x/invisibles.html + +.DS_Store + +# c.f. http://www.westwind.com/reference/os-x/invisibles.html + +.Trashes + +# c.f. http://www.westwind.com/reference/os-x/invisibles.html + +*.swp + +# +# *.lock - this is used and abused by many editors for many different things. +# For the main ones I use (e.g. Eclipse), it should be excluded +# from source-control, but YMMV. +# (lock files are usually local-only file-synchronization on the local FS that should NOT go in git) +# c.f. the "OPTIONAL" section at bottom though, for tool-specific variations! +# +# In particular, if you're using CocoaPods, you'll want to comment-out this line: +# *.lock + + +# +# profile - REMOVED temporarily (on double-checking, I can't find it in OS X docs?) +#profile + + +#### +# Xcode temporary files that should never be committed +# +# NB: NIB/XIB files still exist even on Storyboard projects, so we want this... + +*~.nib + + +#### +# Xcode build files - +# +# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" + +DerivedData/ + +# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" + +build/ + + +##### +# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) +# +# This is complicated: +# +# SOMETIMES you need to put this file in version control. +# Apple designed it poorly - if you use "custom executables", they are +# saved in this file. +# 99% of projects do NOT use those, so they do NOT want to version control this file. +# ..but if you're in the 1%, comment out the line "*.pbxuser" + +# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html + +*.pbxuser + +# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html + +*.mode1v3 + +# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html + +*.mode2v3 + +# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file + +*.perspectivev3 + +# NB: also, whitelist the default ones, some projects need to use these +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + + +#### +# Xcode 4 - semi-personal settings +# +# Apple Shared data that Apple put in the wrong folder +# c.f. http://stackoverflow.com/a/19260712/153422 +# FROM ANSWER: Apple says "don't ignore it" +# FROM COMMENTS: Apple is wrong; Apple code is too buggy to trust; there are no known negative side-effects to ignoring Apple's unofficial advice and instead doing the thing that actively fixes bugs in Xcode +# Up to you, but ... current advice: ignore it. +*.xccheckout + +# +# +# OPTION 1: --------------------------------- +# throw away ALL personal settings (including custom schemes! +# - unless they are "shared") +# As per build/ and DerivedData/, this ought to have a trailing slash +# +# NB: this is exclusive with OPTION 2 below +xcuserdata/ + +# OPTION 2: --------------------------------- +# get rid of ALL personal settings, but KEEP SOME OF THEM +# - NB: you must manually uncomment the bits you want to keep +# +# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X, +# or manually install git over the top of the OS X version +# NB: this is exclusive with OPTION 1 above +# +#xcuserdata/**/* + +# (requires option 2 above): Personal Schemes +# +#!xcuserdata/**/xcschemes/* + +#### +# XCode 4 workspaces - more detailed +# +# Workspaces are important! They are a core feature of Xcode - don't exclude them :) +# +# Workspace layout is quite spammy. For reference: +# +# /(root)/ +# /(project-name).xcodeproj/ +# project.pbxproj +# /project.xcworkspace/ +# contents.xcworkspacedata +# /xcuserdata/ +# /(your name)/xcuserdatad/ +# UserInterfaceState.xcuserstate +# /xcshareddata/ +# /xcschemes/ +# (shared scheme name).xcscheme +# /xcuserdata/ +# /(your name)/xcuserdatad/ +# (private scheme).xcscheme +# xcschememanagement.plist +# +# + +#### +# Xcode 4 - Deprecated classes +# +# Allegedly, if you manually "deprecate" your classes, they get moved here. +# +# We're using source-control, so this is a "feature" that we do not want! + +*.moved-aside + +#### +# OPTIONAL: Some well-known tools that people use side-by-side with Xcode / iOS development +# +# NB: I'd rather not include these here, but gitignore's design is weak and doesn't allow +# modular gitignore: you have to put EVERYTHING in one file. +# +# COCOAPODS: +# +# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#what-is-a-podfilelock +# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +#!Podfile.lock +# +# RUBY: +# +# c.f. http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/ +# +#!Gemfile.lock +# +# IDEA: +# +# c.f. https://www.jetbrains.com/objc/help/managing-projects-under-version-control.html?search=workspace.xml +# +#.idea/workspace.xml +# +# TEXTMATE: +# +# -- UNVERIFIED: c.f. http://stackoverflow.com/a/50283/153422 +# +#tm_build_errors + +#### +# UNKNOWN: recommended by others, but I can't discover what these files are +# + + +/Pods/ \ No newline at end of file diff --git a/DGCAVerifier.xcodeproj/project.pbxproj b/DGCAVerifier.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3654b1f --- /dev/null +++ b/DGCAVerifier.xcodeproj/project.pbxproj @@ -0,0 +1,800 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 52; + objects = { + +/* Begin PBXBuildFile section */ + CE13CF00262DCC180070C80E /* FloatingPanel in Frameworks */ = {isa = PBXBuildFile; productRef = CE13CEFF262DCC180070C80E /* FloatingPanel */; }; + CE13CF05262DCDCD0070C80E /* CertificateViewer.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE13CF04262DCDCD0070C80E /* CertificateViewer.storyboard */; }; + CE13CF0A262DCDDA0070C80E /* CertificateViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE13CF09262DCDDA0070C80E /* CertificateViewer.swift */; }; + CE13CF0F262DD0D80070C80E /* FullFloatingPanelLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE13CF0E262DD0D80070C80E /* FullFloatingPanelLayout.swift */; }; + CE13CF23262DDF810070C80E /* RoundedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE13CF22262DDF810070C80E /* RoundedButton.swift */; }; + CE1D1EF6263597A2004C8919 /* LocalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE1D1EF5263597A2004C8919 /* LocalData.swift */; }; + CE1F155C2639F9E700736D48 /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = CE1F155B2639F9E700736D48 /* SwiftyJSON */; }; + CE37B643263867D700DEE13D /* SecureBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE37B642263867D700DEE13D /* SecureBackground.swift */; }; + CE56B5052639F48E00FB31B1 /* SwiftDGC in Frameworks */ = {isa = PBXBuildFile; productRef = CE56B5042639F48E00FB31B1 /* SwiftDGC */; }; + CE8912F52634C60E00CB92AF /* GatewayConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE8912F42634C60E00CB92AF /* GatewayConnection.swift */; }; + CE8912FB2634C6B900CB92AF /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = CE8912FA2634C6B900CB92AF /* Alamofire */; }; + CE891305263581D900CB92AF /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE891304263581D900CB92AF /* Home.swift */; }; + CEA1555D262F63B30024B7AC /* EuDgcSchema.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA1555C262F63B30024B7AC /* EuDgcSchema.swift */; }; + CEA15563262F6DAB0024B7AC /* ChildDismissedDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA15562262F6DAB0024B7AC /* ChildDismissedDelegate.swift */; }; + CEA1556B262F784E0024B7AC /* SelfSizedTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA1556A262F784E0024B7AC /* SelfSizedTableView.swift */; }; + CEA15570262F79DE0024B7AC /* InfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA1556F262F79DE0024B7AC /* InfoCell.swift */; }; + CEA6D6EC261F8D2700715333 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA6D6EB261F8D2700715333 /* AppDelegate.swift */; }; + CEA6D6EE261F8D2700715333 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA6D6ED261F8D2700715333 /* SceneDelegate.swift */; }; + CEA6D6F0261F8D2700715333 /* Scan.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA6D6EF261F8D2700715333 /* Scan.swift */; }; + CEA6D6F3261F8D2700715333 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEA6D6F1261F8D2700715333 /* Main.storyboard */; }; + CEA6D6F5261F8D2900715333 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CEA6D6F4261F8D2900715333 /* Assets.xcassets */; }; + CEA6D6F8261F8D2900715333 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEA6D6F6261F8D2900715333 /* LaunchScreen.storyboard */; }; + CEA6D703261F8D2900715333 /* DGCAVerifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA6D702261F8D2900715333 /* DGCAVerifierTests.swift */; }; + CEA6D70E261F8D2900715333 /* DGCAVerifierUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA6D70D261F8D2900715333 /* DGCAVerifierUITests.swift */; }; + CED2726026398683003D47A9 /* UIFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = CED2725F26398683003D47A9 /* UIFont.swift */; }; + CEFAD87F262714C4009AFEF9 /* EHNTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEFAD87E262714C4009AFEF9 /* EHNTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + CEA6D6FF261F8D2900715333 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CEA6D6E0261F8D2700715333 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CEA6D6E7261F8D2700715333; + remoteInfo = DGCAVerifier; + }; + CEA6D70A261F8D2900715333 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CEA6D6E0261F8D2700715333 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CEA6D6E7261F8D2700715333; + remoteInfo = DGCAVerifier; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + CE13CF04262DCDCD0070C80E /* CertificateViewer.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = CertificateViewer.storyboard; sourceTree = ""; }; + CE13CF09262DCDDA0070C80E /* CertificateViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CertificateViewer.swift; sourceTree = ""; }; + CE13CF0E262DD0D80070C80E /* FullFloatingPanelLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullFloatingPanelLayout.swift; sourceTree = ""; }; + CE13CF22262DDF810070C80E /* RoundedButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedButton.swift; sourceTree = ""; }; + CE1D1EF5263597A2004C8919 /* LocalData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalData.swift; sourceTree = ""; }; + CE37B642263867D700DEE13D /* SecureBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackground.swift; sourceTree = ""; }; + CE8912F42634C60E00CB92AF /* GatewayConnection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GatewayConnection.swift; sourceTree = ""; }; + CE891304263581D900CB92AF /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; + CEA1555C262F63B30024B7AC /* EuDgcSchema.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EuDgcSchema.swift; sourceTree = ""; }; + CEA15562262F6DAB0024B7AC /* ChildDismissedDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChildDismissedDelegate.swift; sourceTree = ""; }; + CEA1556A262F784E0024B7AC /* SelfSizedTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelfSizedTableView.swift; sourceTree = ""; }; + CEA1556F262F79DE0024B7AC /* InfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoCell.swift; sourceTree = ""; }; + CEA6D6E8261F8D2700715333 /* DGCAVerifier.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DGCAVerifier.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CEA6D6EB261F8D2700715333 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + CEA6D6ED261F8D2700715333 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + CEA6D6EF261F8D2700715333 /* Scan.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Scan.swift; sourceTree = ""; }; + CEA6D6F2261F8D2700715333 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + CEA6D6F4261F8D2900715333 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + CEA6D6F7261F8D2900715333 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + CEA6D6F9261F8D2900715333 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CEA6D6FE261F8D2900715333 /* DGCAVerifierTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DGCAVerifierTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CEA6D702261F8D2900715333 /* DGCAVerifierTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DGCAVerifierTests.swift; sourceTree = ""; }; + CEA6D704261F8D2900715333 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CEA6D709261F8D2900715333 /* DGCAVerifierUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DGCAVerifierUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CEA6D70D261F8D2900715333 /* DGCAVerifierUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DGCAVerifierUITests.swift; sourceTree = ""; }; + CEA6D70F261F8D2900715333 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CED2725F26398683003D47A9 /* UIFont.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIFont.swift; sourceTree = ""; }; + CEDCA7972639E6E700FCB83E /* SwiftDGC */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SwiftDGC; path = "../dgca-app-core-ios"; sourceTree = ""; }; + CEDCA79B2639E77800FCB83E /* Package.resolved */ = {isa = PBXFileReference; lastKnownFileType = text; name = Package.resolved; path = DGCAVerifier.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved; sourceTree = SOURCE_ROOT; }; + CEFAD87E262714C4009AFEF9 /* EHNTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EHNTests.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CEA6D6E5261F8D2700715333 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CE8912FB2634C6B900CB92AF /* Alamofire in Frameworks */, + CE56B5052639F48E00FB31B1 /* SwiftDGC in Frameworks */, + CE1F155C2639F9E700736D48 /* SwiftyJSON in Frameworks */, + CE13CF00262DCC180070C80E /* FloatingPanel in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEA6D6FB261F8D2900715333 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEA6D706261F8D2900715333 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CE13CF19262DDE200070C80E /* Storyboards */ = { + isa = PBXGroup; + children = ( + CEA6D6F6261F8D2900715333 /* LaunchScreen.storyboard */, + CEA6D6F1261F8D2700715333 /* Main.storyboard */, + CE13CF04262DCDCD0070C80E /* CertificateViewer.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + CE13CF1A262DDE330070C80E /* Services */ = { + isa = PBXGroup; + children = ( + CE8912F42634C60E00CB92AF /* GatewayConnection.swift */, + CE37B642263867D700DEE13D /* SecureBackground.swift */, + ); + path = Services; + sourceTree = ""; + }; + CE13CF1B262DDE540070C80E /* Extensions */ = { + isa = PBXGroup; + children = ( + CED2725F26398683003D47A9 /* UIFont.swift */, + ); + path = Extensions; + sourceTree = ""; + }; + CE13CF1C262DDE600070C80E /* ViewControllers */ = { + isa = PBXGroup; + children = ( + CE13CF09262DCDDA0070C80E /* CertificateViewer.swift */, + CEA6D6EF261F8D2700715333 /* Scan.swift */, + CE891304263581D900CB92AF /* Home.swift */, + ); + path = ViewControllers; + sourceTree = ""; + }; + CE13CF1D262DDE730070C80E /* Components */ = { + isa = PBXGroup; + children = ( + CE13CF0E262DD0D80070C80E /* FullFloatingPanelLayout.swift */, + CE13CF22262DDF810070C80E /* RoundedButton.swift */, + CEA1556A262F784E0024B7AC /* SelfSizedTableView.swift */, + CEA1556F262F79DE0024B7AC /* InfoCell.swift */, + ); + path = Components; + sourceTree = ""; + }; + CE13CF1E262DDE800070C80E /* SupportingFiles */ = { + isa = PBXGroup; + children = ( + CEDCA79B2639E77800FCB83E /* Package.resolved */, + CEA6D6EB261F8D2700715333 /* AppDelegate.swift */, + CEA6D6ED261F8D2700715333 /* SceneDelegate.swift */, + CEA6D6F4261F8D2900715333 /* Assets.xcassets */, + CEA6D6F9261F8D2900715333 /* Info.plist */, + CEA1555C262F63B30024B7AC /* EuDgcSchema.swift */, + ); + path = SupportingFiles; + sourceTree = ""; + }; + CE157F8B262E24EC00FE4821 /* Models */ = { + isa = PBXGroup; + children = ( + CE1D1EF5263597A2004C8919 /* LocalData.swift */, + ); + path = Models; + sourceTree = ""; + }; + CE56B5032639F48E00FB31B1 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; + CEA15561262F6DA10024B7AC /* Protocols */ = { + isa = PBXGroup; + children = ( + CEA15562262F6DAB0024B7AC /* ChildDismissedDelegate.swift */, + ); + path = Protocols; + sourceTree = ""; + }; + CEA6D6DF261F8D2700715333 = { + isa = PBXGroup; + children = ( + CEDCA7972639E6E700FCB83E /* SwiftDGC */, + CEA6D6EA261F8D2700715333 /* DGCAVerifier */, + CEA6D701261F8D2900715333 /* DGCAVerifierTests */, + CEA6D70C261F8D2900715333 /* DGCAVerifierUITests */, + CEA6D6E9261F8D2700715333 /* Products */, + CE56B5032639F48E00FB31B1 /* Frameworks */, + ); + sourceTree = ""; + }; + CEA6D6E9261F8D2700715333 /* Products */ = { + isa = PBXGroup; + children = ( + CEA6D6E8261F8D2700715333 /* DGCAVerifier.app */, + CEA6D6FE261F8D2900715333 /* DGCAVerifierTests.xctest */, + CEA6D709261F8D2900715333 /* DGCAVerifierUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + CEA6D6EA261F8D2700715333 /* DGCAVerifier */ = { + isa = PBXGroup; + children = ( + CEA15561262F6DA10024B7AC /* Protocols */, + CE157F8B262E24EC00FE4821 /* Models */, + CE13CF1E262DDE800070C80E /* SupportingFiles */, + CE13CF1D262DDE730070C80E /* Components */, + CE13CF1C262DDE600070C80E /* ViewControllers */, + CE13CF1B262DDE540070C80E /* Extensions */, + CE13CF1A262DDE330070C80E /* Services */, + CE13CF19262DDE200070C80E /* Storyboards */, + ); + path = DGCAVerifier; + sourceTree = ""; + }; + CEA6D701261F8D2900715333 /* DGCAVerifierTests */ = { + isa = PBXGroup; + children = ( + CEA6D702261F8D2900715333 /* DGCAVerifierTests.swift */, + CEA6D704261F8D2900715333 /* Info.plist */, + CEFAD87E262714C4009AFEF9 /* EHNTests.swift */, + ); + path = DGCAVerifierTests; + sourceTree = ""; + }; + CEA6D70C261F8D2900715333 /* DGCAVerifierUITests */ = { + isa = PBXGroup; + children = ( + CEA6D70D261F8D2900715333 /* DGCAVerifierUITests.swift */, + CEA6D70F261F8D2900715333 /* Info.plist */, + ); + path = DGCAVerifierUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CEA6D6E7261F8D2700715333 /* DGCAVerifier */ = { + isa = PBXNativeTarget; + buildConfigurationList = CEA6D712261F8D2900715333 /* Build configuration list for PBXNativeTarget "DGCAVerifier" */; + buildPhases = ( + CEA6D6E4261F8D2700715333 /* Sources */, + CEA6D6E5261F8D2700715333 /* Frameworks */, + CEA6D6E6261F8D2700715333 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DGCAVerifier; + packageProductDependencies = ( + CE13CEFF262DCC180070C80E /* FloatingPanel */, + CE8912FA2634C6B900CB92AF /* Alamofire */, + CE56B5042639F48E00FB31B1 /* SwiftDGC */, + CE1F155B2639F9E700736D48 /* SwiftyJSON */, + ); + productName = DGCAVerifier; + productReference = CEA6D6E8261F8D2700715333 /* DGCAVerifier.app */; + productType = "com.apple.product-type.application"; + }; + CEA6D6FD261F8D2900715333 /* DGCAVerifierTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CEA6D715261F8D2900715333 /* Build configuration list for PBXNativeTarget "DGCAVerifierTests" */; + buildPhases = ( + CEA6D6FA261F8D2900715333 /* Sources */, + CEA6D6FB261F8D2900715333 /* Frameworks */, + CEA6D6FC261F8D2900715333 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CEA6D700261F8D2900715333 /* PBXTargetDependency */, + ); + name = DGCAVerifierTests; + productName = DGCAVerifierTests; + productReference = CEA6D6FE261F8D2900715333 /* DGCAVerifierTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + CEA6D708261F8D2900715333 /* DGCAVerifierUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CEA6D718261F8D2900715333 /* Build configuration list for PBXNativeTarget "DGCAVerifierUITests" */; + buildPhases = ( + CEA6D705261F8D2900715333 /* Sources */, + CEA6D706261F8D2900715333 /* Frameworks */, + CEA6D707261F8D2900715333 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CEA6D70B261F8D2900715333 /* PBXTargetDependency */, + ); + name = DGCAVerifierUITests; + productName = DGCAVerifierUITests; + productReference = CEA6D709261F8D2900715333 /* DGCAVerifierUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CEA6D6E0261F8D2700715333 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1240; + LastUpgradeCheck = 1240; + TargetAttributes = { + CEA6D6E7261F8D2700715333 = { + CreatedOnToolsVersion = 12.4; + }; + CEA6D6FD261F8D2900715333 = { + CreatedOnToolsVersion = 12.4; + TestTargetID = CEA6D6E7261F8D2700715333; + }; + CEA6D708261F8D2900715333 = { + CreatedOnToolsVersion = 12.4; + TestTargetID = CEA6D6E7261F8D2700715333; + }; + }; + }; + buildConfigurationList = CEA6D6E3261F8D2700715333 /* Build configuration list for PBXProject "DGCAVerifier" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = CEA6D6DF261F8D2700715333; + packageReferences = ( + CE13CEFE262DCC180070C80E /* XCRemoteSwiftPackageReference "FloatingPanel" */, + CE8912F92634C6B900CB92AF /* XCRemoteSwiftPackageReference "Alamofire" */, + CE1F155A2639F9E700736D48 /* XCRemoteSwiftPackageReference "SwiftyJSON" */, + ); + productRefGroup = CEA6D6E9261F8D2700715333 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CEA6D6E7261F8D2700715333 /* DGCAVerifier */, + CEA6D6FD261F8D2900715333 /* DGCAVerifierTests */, + CEA6D708261F8D2900715333 /* DGCAVerifierUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CEA6D6E6261F8D2700715333 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE13CF05262DCDCD0070C80E /* CertificateViewer.storyboard in Resources */, + CEA6D6F8261F8D2900715333 /* LaunchScreen.storyboard in Resources */, + CEA6D6F5261F8D2900715333 /* Assets.xcassets in Resources */, + CEA6D6F3261F8D2700715333 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEA6D6FC261F8D2900715333 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEA6D707261F8D2900715333 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CEA6D6E4261F8D2700715333 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CE13CF0A262DCDDA0070C80E /* CertificateViewer.swift in Sources */, + CE37B643263867D700DEE13D /* SecureBackground.swift in Sources */, + CE8912F52634C60E00CB92AF /* GatewayConnection.swift in Sources */, + CE13CF0F262DD0D80070C80E /* FullFloatingPanelLayout.swift in Sources */, + CEA1556B262F784E0024B7AC /* SelfSizedTableView.swift in Sources */, + CE1D1EF6263597A2004C8919 /* LocalData.swift in Sources */, + CED2726026398683003D47A9 /* UIFont.swift in Sources */, + CEA1555D262F63B30024B7AC /* EuDgcSchema.swift in Sources */, + CEA6D6F0261F8D2700715333 /* Scan.swift in Sources */, + CE13CF23262DDF810070C80E /* RoundedButton.swift in Sources */, + CEA6D6EC261F8D2700715333 /* AppDelegate.swift in Sources */, + CE891305263581D900CB92AF /* Home.swift in Sources */, + CEA15563262F6DAB0024B7AC /* ChildDismissedDelegate.swift in Sources */, + CEA15570262F79DE0024B7AC /* InfoCell.swift in Sources */, + CEA6D6EE261F8D2700715333 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEA6D6FA261F8D2900715333 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CEA6D703261F8D2900715333 /* DGCAVerifierTests.swift in Sources */, + CEFAD87F262714C4009AFEF9 /* EHNTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEA6D705261F8D2900715333 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CEA6D70E261F8D2900715333 /* DGCAVerifierUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + CEA6D700261F8D2900715333 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CEA6D6E7261F8D2700715333 /* DGCAVerifier */; + targetProxy = CEA6D6FF261F8D2900715333 /* PBXContainerItemProxy */; + }; + CEA6D70B261F8D2900715333 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CEA6D6E7261F8D2700715333 /* DGCAVerifier */; + targetProxy = CEA6D70A261F8D2900715333 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + CEA6D6F1261F8D2700715333 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEA6D6F2261F8D2700715333 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + CEA6D6F6261F8D2900715333 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEA6D6F7261F8D2900715333 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CEA6D710261F8D2900715333 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + CEA6D711261F8D2900715333 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CEA6D713261F8D2900715333 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KH99XNF745; + INFOPLIST_FILE = DGCAVerifier/SupportingFiles/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.t-systems.DGCAVerifier.dev"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CEA6D714261F8D2900715333 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KH99XNF745; + INFOPLIST_FILE = DGCAVerifier/SupportingFiles/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.t-systems.DGCAVerifier.dev"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + CEA6D716261F8D2900715333 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KH99XNF745; + INFOPLIST_FILE = DGCAVerifier/SupportingFiles/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.t-systems.DGCAVerifierTests.dev"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DGCAVerifier.app/DGCAVerifier"; + }; + name = Debug; + }; + CEA6D717261F8D2900715333 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KH99XNF745; + INFOPLIST_FILE = DGCAVerifier/SupportingFiles/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.t-systems.DGCAVerifierTests.dev"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DGCAVerifier.app/DGCAVerifier"; + }; + name = Release; + }; + CEA6D719261F8D2900715333 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KH99XNF745; + INFOPLIST_FILE = DGCAVerifierUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.t-systems.DGCAVerifierUITests.dev"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = DGCAVerifier; + }; + name = Debug; + }; + CEA6D71A261F8D2900715333 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KH99XNF745; + INFOPLIST_FILE = DGCAVerifierUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.t-systems.DGCAVerifierUITests.dev"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = DGCAVerifier; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CEA6D6E3261F8D2700715333 /* Build configuration list for PBXProject "DGCAVerifier" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CEA6D710261F8D2900715333 /* Debug */, + CEA6D711261F8D2900715333 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CEA6D712261F8D2900715333 /* Build configuration list for PBXNativeTarget "DGCAVerifier" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CEA6D713261F8D2900715333 /* Debug */, + CEA6D714261F8D2900715333 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CEA6D715261F8D2900715333 /* Build configuration list for PBXNativeTarget "DGCAVerifierTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CEA6D716261F8D2900715333 /* Debug */, + CEA6D717261F8D2900715333 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CEA6D718261F8D2900715333 /* Build configuration list for PBXNativeTarget "DGCAVerifierUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CEA6D719261F8D2900715333 /* Debug */, + CEA6D71A261F8D2900715333 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + CE13CEFE262DCC180070C80E /* XCRemoteSwiftPackageReference "FloatingPanel" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SCENEE/FloatingPanel"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 2.3.0; + }; + }; + CE1F155A2639F9E700736D48 /* XCRemoteSwiftPackageReference "SwiftyJSON" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SwiftyJSON/SwiftyJSON"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.0.1; + }; + }; + CE8912F92634C6B900CB92AF /* XCRemoteSwiftPackageReference "Alamofire" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Alamofire/Alamofire"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.4.3; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + CE13CEFF262DCC180070C80E /* FloatingPanel */ = { + isa = XCSwiftPackageProductDependency; + package = CE13CEFE262DCC180070C80E /* XCRemoteSwiftPackageReference "FloatingPanel" */; + productName = FloatingPanel; + }; + CE1F155B2639F9E700736D48 /* SwiftyJSON */ = { + isa = XCSwiftPackageProductDependency; + package = CE1F155A2639F9E700736D48 /* XCRemoteSwiftPackageReference "SwiftyJSON" */; + productName = SwiftyJSON; + }; + CE56B5042639F48E00FB31B1 /* SwiftDGC */ = { + isa = XCSwiftPackageProductDependency; + productName = SwiftDGC; + }; + CE8912FA2634C6B900CB92AF /* Alamofire */ = { + isa = XCSwiftPackageProductDependency; + package = CE8912F92634C6B900CB92AF /* XCRemoteSwiftPackageReference "Alamofire" */; + productName = Alamofire; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = CEA6D6E0261F8D2700715333 /* Project object */; +} diff --git a/DGCAVerifier.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/DGCAVerifier.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/DGCAVerifier.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/DGCAVerifier.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/DGCAVerifier.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/DGCAVerifier.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/DGCAVerifier.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DGCAVerifier.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..0f69fab --- /dev/null +++ b/DGCAVerifier.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,70 @@ +{ + "object": { + "pins": [ + { + "package": "Alamofire", + "repositoryURL": "https://github.com/Alamofire/Alamofire", + "state": { + "branch": null, + "revision": "f96b619bcb2383b43d898402283924b80e2c4bae", + "version": "5.4.3" + } + }, + { + "package": "FloatingPanel", + "repositoryURL": "https://github.com/SCENEE/FloatingPanel", + "state": { + "branch": null, + "revision": "16fea625be25d9a713630a4a43cbc0778740ebf4", + "version": "2.3.0" + } + }, + { + "package": "JSONSchema", + "repositoryURL": "https://github.com/jnewc/JSONSchema.swift", + "state": { + "branch": "master", + "revision": "4637ac1cf57745c29003738f36e1b6c232fbd1a6", + "version": null + } + }, + { + "package": "PathKit", + "repositoryURL": "https://github.com/kylef/PathKit.git", + "state": { + "branch": null, + "revision": "73f8e9dca9b7a3078cb79128217dc8f2e585a511", + "version": "1.0.0" + } + }, + { + "package": "Spectre", + "repositoryURL": "https://github.com/kylef/Spectre.git", + "state": { + "branch": null, + "revision": "f79d4ecbf8bc4e1579fbd86c3e1d652fb6876c53", + "version": "0.9.2" + } + }, + { + "package": "SwiftCBOR", + "repositoryURL": "https://github.com/unrelentingtech/SwiftCBOR", + "state": { + "branch": null, + "revision": "668c26fc3373d5f1bccbaad7665ca6048797e324", + "version": "0.4.3" + } + }, + { + "package": "SwiftyJSON", + "repositoryURL": "https://github.com/SwiftyJSON/SwiftyJSON", + "state": { + "branch": null, + "revision": "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07", + "version": "5.0.1" + } + } + ] + }, + "version": 1 +} diff --git a/DGCAVerifier.xcodeproj/xcshareddata/IDETemplateMacros.plist b/DGCAVerifier.xcodeproj/xcshareddata/IDETemplateMacros.plist new file mode 100644 index 0000000..deb1c68 --- /dev/null +++ b/DGCAVerifier.xcodeproj/xcshareddata/IDETemplateMacros.plist @@ -0,0 +1,34 @@ + + + + + FILEHEADER + +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// ___FILENAME___ +// ___PACKAGENAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// + + + \ No newline at end of file diff --git a/DGCAVerifier.xcodeproj/xcshareddata/xcschemes/DGCAVerifier.xcscheme b/DGCAVerifier.xcodeproj/xcshareddata/xcschemes/DGCAVerifier.xcscheme new file mode 100644 index 0000000..622ac34 --- /dev/null +++ b/DGCAVerifier.xcodeproj/xcshareddata/xcschemes/DGCAVerifier.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DGCAVerifier/Components/FullFloatingPanelLayout.swift b/DGCAVerifier/Components/FullFloatingPanelLayout.swift new file mode 100644 index 0000000..1dcba94 --- /dev/null +++ b/DGCAVerifier/Components/FullFloatingPanelLayout.swift @@ -0,0 +1,40 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// FullFloatingPanelLayout.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/19/21. +// + +import FloatingPanel + +class FullFloatingPanelLayout: FloatingPanelLayout { + var position: FloatingPanelPosition = .bottom + + var initialState: FloatingPanelState = .full + + var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] { + let top = FloatingPanelLayoutAnchor(absoluteInset: 16.0, edge: .top, referenceGuide: .safeArea) + return [ + .full: top, + ] + } +} diff --git a/DGCAVerifier/Components/InfoCell.swift b/DGCAVerifier/Components/InfoCell.swift new file mode 100644 index 0000000..5f301d9 --- /dev/null +++ b/DGCAVerifier/Components/InfoCell.swift @@ -0,0 +1,50 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// InfoCell.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/20/21. +// + +import UIKit +import SwiftDGC + +class InfoCell: UITableViewCell { + @IBOutlet weak var headerLabel: UILabel! + @IBOutlet weak var contentLabel: UILabel! + + func draw(_ info: InfoSection) { + headerLabel?.text = info.header + contentLabel?.text = info.content + let fontSize = contentLabel.font.pointSize + let fontWeight = contentLabel.font.weight + switch info.style { + case .fixedWidthFont: + if #available(iOS 13.0, *) { + contentLabel.font = .monospacedSystemFont(ofSize: fontSize, weight: fontWeight) + } else { + contentLabel.font = .monospacedDigitSystemFont(ofSize: fontSize, weight: fontWeight) + } + default: + contentLabel.font = .systemFont(ofSize: fontSize, weight: fontWeight) + } + } +} diff --git a/DGCAVerifier/Components/RoundedButton.swift b/DGCAVerifier/Components/RoundedButton.swift new file mode 100644 index 0000000..bacf12f --- /dev/null +++ b/DGCAVerifier/Components/RoundedButton.swift @@ -0,0 +1,51 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// RoundedButton.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/19/21. +// + +import Foundation +import UIKit + +@IBDesignable +class RoundedButton: UIButton { + @IBInspectable var radius: CGFloat = 6.0 { didSet(v) { initialize() } } + @IBInspectable var padding: CGFloat = 4.0 { didSet(v) { initialize() } } + + override init(frame: CGRect) { + super.init(frame: frame) + + initialize() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + + initialize() + } + + func initialize() { + layer.cornerRadius = radius + contentEdgeInsets = UIEdgeInsets(top: padding, left: padding, bottom: padding, right: padding) + } +} diff --git a/DGCAVerifier/Components/SelfSizedTableView.swift b/DGCAVerifier/Components/SelfSizedTableView.swift new file mode 100644 index 0000000..1c4062e --- /dev/null +++ b/DGCAVerifier/Components/SelfSizedTableView.swift @@ -0,0 +1,44 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// SelfSizedTableView.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/20/21. +// +// https://dushyant37.medium.com/swift-4-recipe-self-sizing-table-view-2635ac3df8ab +// + +import UIKit + +class SelfSizedTableView: UITableView { + var maxHeight: CGFloat = UIScreen.main.bounds.size.height + + override func reloadData() { + super.reloadData() + self.invalidateIntrinsicContentSize() + self.layoutIfNeeded() + } + + override var intrinsicContentSize: CGSize { + let height = min(contentSize.height, maxHeight) + return CGSize(width: contentSize.width, height: height) + } +} diff --git a/DGCAVerifier/Extensions/UIFont.swift b/DGCAVerifier/Extensions/UIFont.swift new file mode 100644 index 0000000..01e80cd --- /dev/null +++ b/DGCAVerifier/Extensions/UIFont.swift @@ -0,0 +1,46 @@ +// +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// UIFont.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/28/21. +// +// https://stackoverflow.com/a/53818276/2585092 +// + +import UIKit + + +extension UIFont { + public var weight: UIFont.Weight { + guard let weightNumber = traits[.weight] as? NSNumber else { return .regular } + let weightRawValue = CGFloat(weightNumber.doubleValue) + let weight = UIFont.Weight(rawValue: weightRawValue) + return weight + } + + private var traits: [UIFontDescriptor.TraitKey: Any] { + return fontDescriptor.object( + forKey: .traits + ) as? [UIFontDescriptor.TraitKey: Any] ?? [:] + } +} diff --git a/DGCAVerifier/Models/LocalData.swift b/DGCAVerifier/Models/LocalData.swift new file mode 100644 index 0000000..0336450 --- /dev/null +++ b/DGCAVerifier/Models/LocalData.swift @@ -0,0 +1,81 @@ +// +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// LocalData.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/25/21. +// + + +import Foundation +import SwiftDGC + +struct LocalData: Codable { + static var sharedInstance = LocalData() + + var encodedPublicKeys = [String: String]() + var resumeToken: String? + var lastFetch_: Date? + var lastFetch: Date { + get { + lastFetch_ ?? .init(timeIntervalSince1970: 0) + } + set(v) { + lastFetch_ = v + } + } + + mutating func add(encodedPublicKey: String) { + let kid = KID.from(encodedPublicKey) + let kidStr = KID.string(from: kid) + + encodedPublicKeys[kidStr] = encodedPublicKey + } + + static func set(resumeToken: String) { + sharedInstance.resumeToken = resumeToken + } + + public func save() { + Self.storage.save(self) + } + + static let storage = SecureStorage() + + static func initialize(completion: @escaping () -> Void) { + storage.loadOverride(fallback: LocalData.sharedInstance) { success in + guard let result = success else { + return + } + print("\(result.encodedPublicKeys.count) certs loaded.") + LocalData.sharedInstance = result + completion() + } + HCert.publicKeyStorageDelegate = LocalDataDelegate() + } +} + +struct LocalDataDelegate: PublicKeyStorageDelegate { + func getEncodedPublicKey(for kidStr: String) -> String? { + LocalData.sharedInstance.encodedPublicKeys[kidStr] + } +} diff --git a/DGCAVerifier/Protocols/ChildDismissedDelegate.swift b/DGCAVerifier/Protocols/ChildDismissedDelegate.swift new file mode 100644 index 0000000..735cf0a --- /dev/null +++ b/DGCAVerifier/Protocols/ChildDismissedDelegate.swift @@ -0,0 +1,31 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// ChildDismissedDelegate.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/20/21. +// + +import Foundation + +protocol ChildDismissedDelegate { + func childDismissed() +} diff --git a/DGCAVerifier/Services/GatewayConnection.swift b/DGCAVerifier/Services/GatewayConnection.swift new file mode 100644 index 0000000..7431045 --- /dev/null +++ b/DGCAVerifier/Services/GatewayConnection.swift @@ -0,0 +1,126 @@ +// +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// GatewayConnection.swift +// PatientScannerDemo +// +// Created by Yannick Spreen on 4/24/21. +// + + +import Foundation +import Alamofire +import SwiftDGC +import SwiftyJSON + +struct GatewayConnection { + static let serverURI = "https://dgca-verifier-service.cfapps.eu10.hana.ondemand.com/" + static let updateEndpoint = "signercertificateUpdate" + static let statusEndpoint = "signercertificateStatus" + + public static func certUpdate(resume resumeToken: String? = nil, completion: ((String?, String?) -> Void)?) { + var headers = [String: String]() + if let token = resumeToken { + headers["x-resume-token"] = token + } + AF.request(serverURI + updateEndpoint, method: .get, parameters: nil, encoding: URLEncoding(), headers: .init(headers), interceptor: nil, requestModifier: nil).response { + if + let status = $0.response?.statusCode, + status == 204 { + completion?(nil, nil) + return + } + guard + case let .success(result) = $0.result, + let response = result, + let responseStr = String(data: response, encoding: .utf8), + let headers = $0.response?.headers, + let responseKid = headers["x-kid"], + let newResumeToken = headers["x-resume-token"] + else { + return + } + let kid = KID.from(responseStr) + let kidStr = KID.string(from: kid) + if kidStr != responseKid { + return + } + completion?(responseStr, newResumeToken) + } + } + public static func certStatus(resume resumeToken: String? = nil, completion: (([String]) -> Void)?) { + AF.request(serverURI + statusEndpoint).response { + guard + case let .success(result) = $0.result, + let response = result, + let responseStr = String(data: response, encoding: .utf8), + let json = JSON(parseJSON: responseStr).array + else { + return + } + let kids = json.compactMap { $0.string } + completion?(kids) + } + } + + static var timer: Timer? + + public static func initialize() { + timer?.invalidate() + timer = Timer.scheduledTimer(withTimeInterval: 60.0, repeats: true) { + _ in trigger() + } + timer?.tolerance = 5.0 + trigger() + } + + static func trigger() { + guard LocalData.sharedInstance.lastFetch.timeIntervalSinceNow < -24 * 60 * 60 else { + return + } + update() + } + + static func update() { + certUpdate(resume: LocalData.sharedInstance.resumeToken) { encodedCert, token in + LocalData.sharedInstance.lastFetch = Date() + guard let encodedCert = encodedCert else { + status() + return + } + LocalData.sharedInstance.add(encodedPublicKey: encodedCert) + LocalData.sharedInstance.resumeToken = token + update() + } + } + + static func status() { + certStatus { validKids in + let invalid = LocalData.sharedInstance.encodedPublicKeys.keys.filter { + !validKids.contains($0) + } + for key in invalid { + LocalData.sharedInstance.encodedPublicKeys.removeValue(forKey: key) + } + LocalData.sharedInstance.save() + } + } +} diff --git a/DGCAVerifier/Services/SecureBackground.swift b/DGCAVerifier/Services/SecureBackground.swift new file mode 100644 index 0000000..ed655cf --- /dev/null +++ b/DGCAVerifier/Services/SecureBackground.swift @@ -0,0 +1,52 @@ +// +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// SecureBackground.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/27/21. +// + + +import Foundation +import UIKit + +struct SecureBackground { + static var imageView: UIImageView? + public static var image: UIImage? + + public static func enable() { + disable() + guard let image = image else { + return + } + let imageView = UIImageView(image: image) + UIApplication.shared.windows[0].addSubview(imageView) + Self.imageView = imageView + } + + public static func disable() { + if imageView != nil { + imageView?.removeFromSuperview() + imageView = nil + } + } +} diff --git a/DGCAVerifier/Storyboards/Base.lproj/LaunchScreen.storyboard b/DGCAVerifier/Storyboards/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..a3d9091 --- /dev/null +++ b/DGCAVerifier/Storyboards/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DGCAVerifier/Storyboards/Base.lproj/Main.storyboard b/DGCAVerifier/Storyboards/Base.lproj/Main.storyboard new file mode 100644 index 0000000..e29862b --- /dev/null +++ b/DGCAVerifier/Storyboards/Base.lproj/Main.storyboard @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DGCAVerifier/Storyboards/CertificateViewer.storyboard b/DGCAVerifier/Storyboards/CertificateViewer.storyboard new file mode 100644 index 0000000..1cc2c0d --- /dev/null +++ b/DGCAVerifier/Storyboards/CertificateViewer.storyboard @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DGCAVerifier/SupportingFiles/AppDelegate.swift b/DGCAVerifier/SupportingFiles/AppDelegate.swift new file mode 100644 index 0000000..ad67e04 --- /dev/null +++ b/DGCAVerifier/SupportingFiles/AppDelegate.swift @@ -0,0 +1,46 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// AppDelegate.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/8/21. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + SecureBackground.enable() + } + + func applicationDidBecomeActive(_ application: UIApplication) { + SecureBackground.disable() + } + +} + diff --git a/DGCAVerifier/SupportingFiles/Assets.xcassets/AccentColor.colorset/Contents.json b/DGCAVerifier/SupportingFiles/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/DGCAVerifier/SupportingFiles/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DGCAVerifier/SupportingFiles/Assets.xcassets/AppIcon.appiconset/Contents.json b/DGCAVerifier/SupportingFiles/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/DGCAVerifier/SupportingFiles/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DGCAVerifier/SupportingFiles/Assets.xcassets/Contents.json b/DGCAVerifier/SupportingFiles/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/DGCAVerifier/SupportingFiles/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-2.imageset/Contents.json b/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-2.imageset/Contents.json new file mode 100644 index 0000000..7d903a7 --- /dev/null +++ b/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "hea_dgf_icons-2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-2.imageset/hea_dgf_icons-2.png b/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-2.imageset/hea_dgf_icons-2.png new file mode 100644 index 0000000..a76cb34 Binary files /dev/null and b/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-2.imageset/hea_dgf_icons-2.png differ diff --git a/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-3.imageset/Contents.json b/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-3.imageset/Contents.json new file mode 100644 index 0000000..7d903a7 --- /dev/null +++ b/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "hea_dgf_icons-2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-3.imageset/hea_dgf_icons-2.png b/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-3.imageset/hea_dgf_icons-2.png new file mode 100644 index 0000000..2fd9815 Binary files /dev/null and b/DGCAVerifier/SupportingFiles/Assets.xcassets/hea_dgf_icons-3.imageset/hea_dgf_icons-2.png differ diff --git a/DGCAVerifier/SupportingFiles/EuDgcSchema.swift b/DGCAVerifier/SupportingFiles/EuDgcSchema.swift new file mode 100644 index 0000000..46f66b8 --- /dev/null +++ b/DGCAVerifier/SupportingFiles/EuDgcSchema.swift @@ -0,0 +1,361 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// EuDgcSchema.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/20/21. +// +// https://raw.githubusercontent.com/ehn-digital-green-development/ehn-dgc-schema/main/DGC.combined-schema.json +// + +import Foundation + +let EU_DGC_SCHEMA_V1 = """ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://id.uvci.eu/DGC.combined-schema.json", + "title": "EU DGC", + "description": "EU Digital Green Certificate", + "required": [ + "ver", + "nam", + "dob" + ], + "type": "object", + "properties": { + "ver": { + "title": "Schema version", + "description": "Version of the schema, according to Semantic versioning (ISO, https://semver.org/ version 2.0.0 or newer)", + "type": "string", + "pattern": "^\\\\d+.\\\\d+.\\\\d+$", + "examples": [ + "1.0.0" + ] + }, + "nam": { + "description": "Surname(s), given name(s) - in that order", + "$ref": "#/$defs/person_name" + }, + "dob": { + "title": "Date of birth", + "description": "Date of Birth of the person addressed in the DGC. ISO 8601 date format restricted to range 1900-2099", + "type": "string", + "format": "date", + "pattern": "[19|20][0-9][0-9]-(0[1-9]|1[0-2])-([0-2][1-9]|3[0|1])", + "examples": [ + "1979-04-14" + ] + }, + "v": { + "description": "Vaccination Group", + "type": "array", + "items": { + "$ref": "#/$defs/vaccination_entry" + }, + "minItems": 1 + }, + "t": { + "description": "Test Group", + "type": "array", + "items": { + "$ref": "#/$defs/test_entry" + }, + "minItems": 1 + }, + "r": { + "description": "Recovery Group", + "type": "array", + "items": { + "$ref": "#/$defs/recovery_entry" + }, + "minItems": 1 + } + }, + "$defs": { + "dose_posint": { + "description": "Dose Number / Total doses in Series: positive integer, range: [1,9]", + "type": "integer", + "minimum": 1, + "maximum": 9 + }, + "country_vt": { + "description": "Country of Vaccination / Test, ISO 3166 where possible", + "type": "string", + "pattern": "[A-Z]{1,10}" + }, + "issuer": { + "description": "Certificate Issuer", + "type": "string", + "maxLength": 50 + }, + "person_name": { + "description": "Person name: Surname(s), given name(s) - in that order", + "required": [ + "fnt" + ], + "type": "object", + "properties": { + "fn": { + "title": "Family name", + "description": "The family or primary name(s) of the person addressed in the certificate", + "type": "string", + "maxLength": 50, + "examples": [ + "d'Červenková Panklová" + ] + }, + "fnt": { + "title": "Standardised family name", + "description": "The family name(s) of the person transliterated", + "type": "string", + "pattern": "^[A-Z<]*$", + "maxLength": 50, + "examples": [ + "DCERVENKOVA + + + + NSFaceIDUsageDescription + Unlock sensitive data. + UIUserInterfaceStyle + Light + NSCameraUsageDescription + Scan barcodes with your camera. + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/DGCAVerifier/SupportingFiles/SceneDelegate.swift b/DGCAVerifier/SupportingFiles/SceneDelegate.swift new file mode 100644 index 0000000..bfb1731 --- /dev/null +++ b/DGCAVerifier/SupportingFiles/SceneDelegate.swift @@ -0,0 +1,44 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// SceneDelegate.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/8/21. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + @available(iOS 13.0, *) + func sceneWillResignActive(_ scene: UIScene) { + SecureBackground.enable() + } + + @available(iOS 13.0, *) + func sceneDidBecomeActive(_ scene: UIScene) { + SecureBackground.disable() + } + +} + diff --git a/DGCAVerifier/ViewControllers/CertificateViewer.swift b/DGCAVerifier/ViewControllers/CertificateViewer.swift new file mode 100644 index 0000000..ac42d01 --- /dev/null +++ b/DGCAVerifier/ViewControllers/CertificateViewer.swift @@ -0,0 +1,137 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// CertificateViewer.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/19/21. +// + +import Foundation +import UIKit +import FloatingPanel +import SwiftDGC + +let DISMISS_TIMEOUT = 15.0 + +let validityString = [ + HCertValidity.valid: "Valid ✓", + HCertValidity.invalid: "Invalid Ⅹ", +] +let buttonText = [ + HCertValidity.valid: "Okay", + HCertValidity.invalid: "Retry", +] +let backgroundColor = [ + HCertValidity.valid: UIColor(red: 0.08126, green: 0.19497, blue: 0.07434, alpha: 1), + HCertValidity.invalid: UIColor(red: 0.36290, green: 0, blue: 0, alpha: 1), +] +let textColor = [ + HCertValidity.valid: UIColor(red: 0.37632, green: 1, blue: 0.54549, alpha: 1), + HCertValidity.invalid: UIColor(red: 1, green: 0.14316, blue: 0.14316, alpha: 1), +] + +class CertificateViewerVC: UIViewController { + @IBOutlet weak var nameLabel: UILabel! + @IBOutlet weak var validityLabel: UILabel! + @IBOutlet weak var loadingBackground: UIView! + @IBOutlet weak var loadingBackgroundTrailing: NSLayoutConstraint! + @IBOutlet weak var typeSegments: UISegmentedControl! + @IBOutlet weak var infoTable: UITableView! + @IBOutlet weak var dismissButton: UIButton! + + var hCert: HCert! { + didSet { + self.draw() + } + } + + var childDismissedDelegate: ChildDismissedDelegate? + + func draw() { + nameLabel.text = hCert.fullName + infoTable.reloadData() + typeSegments.selectedSegmentIndex = [ + HCertType.test, + HCertType.vaccineOne, + HCertType.vaccineTwo, + HCertType.recovery + ].firstIndex(of: hCert.type) ?? 0 + let validity = hCert.validity + dismissButton.setTitle(buttonText[validity], for: .normal) + dismissButton.backgroundColor = textColor[validity] + dismissButton.setTitleColor(backgroundColor[validity], for: .normal) + validityLabel.text = validityString[validity] + validityLabel.textColor = textColor[validity] + view.backgroundColor = backgroundColor[validity] + } + + override func viewDidLoad() { + super.viewDidLoad() + // selected option color + typeSegments.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.black], for: .selected) + // color of other options + typeSegments.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.white], for: .normal) + + infoTable.dataSource = self + + return + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + loadingBackground.layer.zPosition = -1 + loadingBackgroundTrailing.priority = .init(200) + UIView.animate(withDuration: DISMISS_TIMEOUT, delay: 0, options: .curveLinear) { [weak self] in + self?.view.layoutIfNeeded() + } + DispatchQueue.main.asyncAfter(deadline: .now() + DISMISS_TIMEOUT) { [weak self] in + self?.dismiss(animated: true, completion: nil) + } + + return + } + + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + + childDismissedDelegate?.childDismissed() + } + + @IBAction + func closeButton() { + dismiss(animated: true, completion: nil) + } +} + +extension CertificateViewerVC: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return hCert.info.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let base = tableView.dequeueReusableCell(withIdentifier: "infoCell", for: indexPath) + guard let cell = base as? InfoCell else { + return base + } + cell.draw(hCert.info[indexPath.row]) + return cell + } +} diff --git a/DGCAVerifier/ViewControllers/Home.swift b/DGCAVerifier/ViewControllers/Home.swift new file mode 100644 index 0000000..5a4e040 --- /dev/null +++ b/DGCAVerifier/ViewControllers/Home.swift @@ -0,0 +1,50 @@ +// +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// Home.swift +// PatientScannerDemo +// +// Created by Yannick Spreen on 4/25/21. +// + + +import Foundation +import UIKit + +class HomeVC: UIViewController { + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + GatewayConnection.timer?.invalidate() + LocalData.initialize { + DispatchQueue.main.async { [weak self] in + guard let self = self else { + return + } + let renderer = UIGraphicsImageRenderer(size: self.view.bounds.size) + SecureBackground.image = renderer.image { rendererContext in + self.view.layer.render(in: rendererContext.cgContext) + } + self.performSegue(withIdentifier: "scanner", sender: self) + } + } + } +} diff --git a/DGCAVerifier/ViewControllers/Scan.swift b/DGCAVerifier/ViewControllers/Scan.swift new file mode 100644 index 0000000..0397148 --- /dev/null +++ b/DGCAVerifier/ViewControllers/Scan.swift @@ -0,0 +1,76 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-verifier-app-ios + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ +// +// ViewController.swift +// DGCAVerifier +// +// Created by Yannick Spreen on 4/8/21. +// +// https://www.raywenderlich.com/12663654-vision-framework-tutorial-for-ios-scanning-barcodes +// + +import UIKit +import SwiftDGC +import FloatingPanel + +class ScanVC: SwiftDGC.ScanVC { + override func viewDidLoad() { + super.viewDidLoad() + + delegate = self + GatewayConnection.initialize() + } + + var presentingViewer: CertificateViewerVC? + func presentViewer(for certificate: HCert) { + guard + presentingViewer == nil, + let contentVC = UIStoryboard(name: "CertificateViewer", bundle: nil) + .instantiateInitialViewController(), + let viewer = contentVC as? CertificateViewerVC + else { + return + } + + let fpc = FloatingPanelController() + fpc.set(contentViewController: viewer) + fpc.isRemovalInteractionEnabled = true // Let it removable by a swipe-down + fpc.layout = FullFloatingPanelLayout() + fpc.surfaceView.layer.cornerRadius = 24.0 + fpc.surfaceView.clipsToBounds = true + viewer.hCert = certificate + viewer.childDismissedDelegate = self + presentingViewer = viewer + + present(fpc, animated: true, completion: nil) + } +} + +extension ScanVC: ScanVCDelegate { + func hCertScanned(_ cert: HCert) { + presentViewer(for: cert) + } +} + +extension ScanVC: ChildDismissedDelegate { + func childDismissed() { + presentingViewer = nil + } +} diff --git a/DGCAVerifierTests/DGCAVerifierTests.swift b/DGCAVerifierTests/DGCAVerifierTests.swift new file mode 100644 index 0000000..84fd71e --- /dev/null +++ b/DGCAVerifierTests/DGCAVerifierTests.swift @@ -0,0 +1,33 @@ +// +// DGCAVerifierTests.swift +// DGCAVerifierTests +// +// Created by Yannick Spreen on 4/8/21. +// + +import XCTest +@testable import DGCAVerifier + +class DGCAVerifierTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/DGCAVerifierTests/EHNTests.swift b/DGCAVerifierTests/EHNTests.swift new file mode 100644 index 0000000..ef22027 --- /dev/null +++ b/DGCAVerifierTests/EHNTests.swift @@ -0,0 +1,142 @@ +// +// EHNTests.swift +// EHNTests +// +// Created by Dirk-Willem van Gulik on 01/04/2021. +// + +@testable import DGCAVerifier +import XCTest + +class EHNTests: XCTestCase { + func testCoseEcdsa() throws { + var barcode = "HC1:NCFY70R30FFWTWGSLKC 4O992$V M63TMF2V*D9LPC.3EHPCGEC27B72VF/347O4-M6Y9M6FOYG4ILDEI8GR3ZI$15MABL:E9CVBGEEWRMLE C39S0/ANZ52T82Z-73D63P1U 1$PKC 72H2XX09WDH889V5" + + let trustJson = """ + [ + { + \"kid\" : \"DEFBBA3378B322F5\", + \"coord\" : [ + \"230ca0433313f4ef14ec0ab0477b241781d135ee09369507fcf44ca988ed09d6\", + \"bf1bfe3d2bda606c841242b59c568d00e5c8dd114d223b2f5036d8c5bc68bf5d\" + ] + }, + { + \"kid\" : \"FFFBBA3378B322F5\", + \"coord\" : [ + \"9999a0433313f4ef14ec0ab0477b241781d135ee09369507fcf44ca988ed09d6\", + \"9999fe3d2bda606c841242b59c568d00e5c8dd114d223b2f5036d8c5bc68bf5d\" + ] + } + ] + """ + + // Remove HC1 header if any (v0.0.3 'HC1', v0.0.4 'HC1:') + // + if (barcode.hasPrefix("HC1:")) { + barcode = String(barcode.suffix(barcode.count-4)) + } + + guard + let compressed = try? barcode.fromBase45() + else { + XCTAssert(false) + return + } + + let data = decompress(compressed) + + guard + let payload = CBOR.payload(from: data), + let kid = CBOR.kid(from: data), + let trustData = trustJson.data(using: .utf8), + let trustSerialization = try? JSONSerialization.jsonObject(with: trustData, options: []), + let trust = trustSerialization as? [[String: Any]] + else { + XCTAssert(false) + return + } + for case let elem: Dictionary in trust { + if + kid == Data(hexString: elem["kid"] as! String)?.uint, + let x = (elem["coord"] as? Array)?[0] as? String, + let y = (elem["coord"] as? Array)?[1] as? String + { + print("We know this KID - check if this sig works...") + if COSE.verify(data, with: x, and: y) { + print("All is well! Payload: ", payload) + return + } + print("- sig failed - which is OK - we may have more matching KIDS --") + } + } + print("Nope - all failed - sadness all around") + XCTAssert(false) + } + func testCoseEcAT() throws { + let barcode = "HC1:NCFC:M/8OBK2 53WGEI1J%1IEAKE%GKV5B8M38S78UU+RRIR+1CT013E9ZI8$*NVQE+PQKR434V:-NN551/A*HSD87*JGTPKU77HTHOTIY/9VPKP859+1Q-1JCFL:O8SBM:5I%7X2NRAQ1XL0$E867W1FH-NIAWOQJEFELCNXMT7S739DJ2G2*CYG9IEMEU7/.B%E9 $0DKJPRIK-RRX2WBPOFE32TW HL24/YI4SO5LF04NZ-D O9$K9$IHYTC4JB622YMQ.5LVXH64JFGG-L0LJTW88O.L5T48AW2MTJD8CL4OUE4V2HX88FAH 89NKJS2SMPU%I8OC0AEPJ0 F2SMTERNC7CM20P00C9L8MBI.PMP9WWG6ICY$FK/QARHN+JX8S24UU00CEAA:SQUTY0LPRGQXVN6Q*UR-WH/FC8CJQ8WLBJH$47O8+.GMF78*A85H1GU4SPNC3TVKQBK:7C836%WI/QR$EC0YE:E77%LHAE5T07AVLUPLW38MMNF00 CE9U$-VKYU ZN1V3C:M9YH.RDK%VQSC.GRN29JSENCEX7SQ.J6:4D28Z*E*3V5/R6Q7*:3I R+1GUZQ$LBB 7B-E2KTU/0X1B- UKUJJ2U0.H 0RM2GBGIQ+M" + return baseTestAT(barcode: barcode) + } + func testCoseRsaAT() throws { + let barcode = "HC1:NCFOXNYTS3DH$YO:CQSU40 H 804 2FI15B3LR5OGILG9N:5-RII9DL-VAD65D6 NI4EFFZSE+S.SSH2HGUS XKVD9HB58QHVM6IQ17XH0S9S-JX%EI$HGL24EGYJ2SKISE02UQHPMYO9MN9JUHLKH.O93UQFJ6GL28LHXOAYJAPRAAUICO10W59UE1YHU-H4PIUF2VSJGV4J4LV/AYVG2$436D$X40YC2ATNS4Y6TKR2*G5C%CO8TJV4423 L0VV2 73-E3ND3DAJ-432$4U1JS.S./0LWTKD33236J3TA3E-4%:K7-SN2H N37J3JFTULJ5CBP:2C 2+*4HTC/2DBAJDAJCNB-43GV4MCTKD08DJHSI PISVDGZK4EC8.SX1LC8C8DJOMI$MI-N09*0245$UH8QIBD2GMJCKH9AO2R7./HBR6$LE KMDGKRFRSGHQED10H% 0R%0D 8YIPFHL:OTEGJUY25$0P/HX$4T0H//CI+CF/8-0LO1PX$4D4TVZ0D-4VZ0S1LZ0L:M623Q$B65VCNAIO38ZIIT-ROGV86O*$2/6PSQHV-P TN3H38EU2VME.3F$MM3WYC3A1N%IFBZV3P6$A9X81M:L-5TTPNFIVD6KL/O63UX0O7V9BYEB:IB BUAA9JM:ATN.AR81Y4GP21CPVY6P:KPG:LNLL%70/6MRVMT0LV0E7*EVLS2UIU6V2M3%26%Q3J*H:5L-28SXRWUH$LCQ/S3QTY5NG.8C5MN$V4-BXJMF5RG3U6-1RDVRWNY$3/ZB3MOQDWC*08M0AV5*/0QX4B-EF0MGH5X1FYHRGX8:+RY/EI%BQ95TC5*DW/ESR4S0:1ZF59*5GK1-OH4Z6-6FUOTN*H$38IPR4GT1$OE07B*SWKN*HF83N MO.CFOW3R%GB28Z$UOH7DROI9BW/CXPS0.PS USQE:LAVZP320%R902" + return baseTestAT(barcode: barcode) + } + func baseTestAT(barcode: String) { + var barcode = barcode + // Remove HC1 header if any + if (barcode.hasPrefix("HC1:")) { + barcode = String(barcode.suffix(barcode.count-4)) + } + + guard + let compressed = try? barcode.fromBase45() + else { + XCTAssert(false) + return + } + + let data = decompress(compressed) + + guard + let kidBytes = CBOR.kid(from: data) + else { + XCTAssert(false) + return + } + let kid = KID.string(from: kidBytes) + guard + let url = URL(string: "https://dgc.a-sit.at/ehn/cert/\(kid)") + else { + XCTAssert(false) + return + } + let expectation = XCTestExpectation(description: "Download PubKey") + URLSession.shared.dataTask(with: URLRequest(url: url)) { body, response, error in + guard + error == nil, + let status = (response as? HTTPURLResponse)?.statusCode, + 200 == status, + let body = body + else { + XCTAssert(false) + return + } + let encodedCert = body.base64EncodedString() + XCTAssert(KID.string(from: KID.from(encodedCert)) == kid) + if COSE.verify(data, with: encodedCert) { + expectation.fulfill() + } else { + XCTAssert(false) + } + }.resume() + wait(for: [expectation], timeout: 15) + } +} + +/** + + Produces: + + All is well! Payload: map([SwiftCBOR.CBOR.utf8String("foo"): SwiftCBOR.CBOR.utf8String("bar")]) + + */ diff --git a/DGCAVerifierTests/Info.plist b/DGCAVerifierTests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/DGCAVerifierTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/DGCAVerifierUITests/DGCAVerifierUITests.swift b/DGCAVerifierUITests/DGCAVerifierUITests.swift new file mode 100644 index 0000000..6703018 --- /dev/null +++ b/DGCAVerifierUITests/DGCAVerifierUITests.swift @@ -0,0 +1,42 @@ +// +// DGCAVerifierUITests.swift +// DGCAVerifierUITests +// +// Created by Yannick Spreen on 4/8/21. +// + +import XCTest + +class DGCAVerifierUITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/DGCAVerifierUITests/Info.plist b/DGCAVerifierUITests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/DGCAVerifierUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/NOTICE b/NOTICE index d7bf1bb..77c2a9b 100644 --- a/NOTICE +++ b/NOTICE @@ -7,4 +7,5 @@ Contributors: ------------- Daniel Eder [daniel-eder], T-Mobile International Austria GmbH -Andreas Scheibal [ascheibal], T-Systems International GmbH \ No newline at end of file +Andreas Scheibal [ascheibal], T-Systems International GmbH +Yannick Spreen [yspreen], yspreen.com \ No newline at end of file diff --git a/README.md b/README.md index 2f8face..532240d 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This repository contains the source code of the Digital Green Certificates Verifier App for iOS. -The DGC Verifier Apps are responsible for scanning and verifying DGCs using public keys from national backend servers. Offline verification is supported, if the latest public keys are present in the app's key store. Consequently, once up-to-date keys have been downloaded, the verification works without active internet connection. +The DGC Verifier Apps are responsible for scanning and verifying DGCs using public keys from national backend servers. Offline verification is supported, if the latest public keys are present in the app's key store. Consequently, once up-to-date keys have been downloaded, the verification works without active internet connection. ## Development @@ -34,13 +34,14 @@ The DGC Verifier Apps are responsible for scanning and verifying DGCs using publ Whether you cloned or downloaded the 'zipped' sources you will either find the sources in the chosen checkout-directory or get a zip file with the source code, which you can expand to a folder of your choice. -In either case open a terminal pointing to the directory you put the sources in. The local build process is described afterwards depending on the way you choose. +#### Xcode based build -#### XYZ (Maven, Docker ...) based build +- Set the development team to any Apple Developer Account +- Give the project a unique bundle identifier +- Install swift package manager requirements through Xcode 12.4+ +- Build and run the project through Xcode 12.4+ -- [ ] TODO: Add instructions for different build types - -## Documentation +## Documentation - [ ] TODO: Link to documentation @@ -48,16 +49,16 @@ In either case open a terminal pointing to the directory you put the sources in. The following channels are available for discussions, feedback, and support requests: -| Type | Channel | -| ------------------------ | ------------------------------------------------------ | -| **Issues** | | -| **Other requests** | | +| Type | Channel | +| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Issues** | | +| **Other requests** | | -## How to contribute +## How to contribute Contribution and feedback is encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](./CONTRIBUTING.md). By participating in this project, you agree to abide by its [Code of Conduct](./CODE_OF_CONDUCT.md) at all times. -## Contributors +## Contributors Our commitment to open source means that we are enabling -in fact encouraging- all interested parties to contribute and become part of its developer community. diff --git a/templates/file-header.txt b/templates/file-header.txt index 9ffd499..55ce82f 100644 --- a/templates/file-header.txt +++ b/templates/file-header.txt @@ -1,6 +1,6 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-verifier-app-web + * eu-digital-green-certificates / dgca-verifier-app-ios * --- * Copyright (C) 2021 T-Systems International GmbH and all other contributors * --- @@ -17,3 +17,9 @@ * limitations under the License. * ---license-end */ +// +// ___FILENAME___ +// ___PACKAGENAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +//