capacitor-secure-storage-plugin 0.6.1 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/CapacitorSecureStoragePlugin.podspec +12 -7
  3. package/README.md +6 -5
  4. package/android/build.gradle +13 -7
  5. package/android/src/main/AndroidManifest.xml +3 -5
  6. package/android/src/main/java/com/whitestein/securestorage/{SecureStoragePlugin.java → SecureStoragePluginPlugin.java} +33 -16
  7. package/android/{.gradle/5.6.4/gc.properties → src/main/res/.gitkeep} +0 -0
  8. package/dist/docs.json +93 -0
  9. package/dist/esm/definitions.js +1 -0
  10. package/dist/esm/definitions.js.map +1 -1
  11. package/dist/esm/index.js +1 -1
  12. package/dist/esm/index.js.map +1 -1
  13. package/dist/esm/web.d.ts +2 -4
  14. package/dist/esm/web.js +15 -11
  15. package/dist/esm/web.js.map +1 -1
  16. package/dist/plugin.cjs.js +64 -0
  17. package/dist/plugin.cjs.js.map +1 -0
  18. package/dist/plugin.js +67 -0
  19. package/dist/plugin.js.map +1 -0
  20. package/ios/Plugin/{Plugin.h → SecureStoragePluginPlugin.h} +0 -0
  21. package/ios/Plugin/{Plugin.m → SecureStoragePluginPlugin.m} +0 -0
  22. package/ios/Plugin/{Plugin.swift → SecureStoragePluginPlugin.swift} +18 -9
  23. package/package.json +56 -29
  24. package/android/.gitignore +0 -72
  25. package/android/.gradle/5.6.4/executionHistory/executionHistory.bin +0 -0
  26. package/android/.gradle/5.6.4/executionHistory/executionHistory.lock +0 -0
  27. package/android/.gradle/5.6.4/fileChanges/last-build.bin +0 -0
  28. package/android/.gradle/5.6.4/fileContent/fileContent.lock +0 -0
  29. package/android/.gradle/5.6.4/fileHashes/fileHashes.bin +0 -0
  30. package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
  31. package/android/.gradle/5.6.4/fileHashes/resourceHashesCache.bin +0 -0
  32. package/android/.gradle/5.6.4/javaCompile/classAnalysis.bin +0 -0
  33. package/android/.gradle/5.6.4/javaCompile/jarAnalysis.bin +0 -0
  34. package/android/.gradle/5.6.4/javaCompile/javaCompile.lock +0 -0
  35. package/android/.gradle/5.6.4/javaCompile/taskHistory.bin +0 -0
  36. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  37. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  38. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  39. package/android/.gradle/vcs-1/gc.properties +0 -0
  40. package/android/.idea/.gitignore +0 -3
  41. package/android/.idea/compiler.xml +0 -6
  42. package/android/.idea/gradle.xml +0 -20
  43. package/android/.idea/jarRepositories.xml +0 -30
  44. package/android/.idea/libraries/Gradle__androidx_activity_activity_1_2_0_aar.xml +0 -16
  45. package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0.xml +0 -13
  46. package/android/.idea/libraries/Gradle__androidx_annotation_annotation_experimental_1_0_0_aar.xml +0 -13
  47. package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_2_0_aar.xml +0 -16
  48. package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_2_0_aar.xml +0 -13
  49. package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0.xml +0 -11
  50. package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_1_0_aar.xml +0 -13
  51. package/android/.idea/libraries/Gradle__androidx_collection_collection_1_1_0.xml +0 -11
  52. package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_1_0_aar.xml +0 -16
  53. package/android/.idea/libraries/Gradle__androidx_core_core_1_3_2_aar.xml +0 -16
  54. package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +0 -13
  55. package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +0 -13
  56. package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +0 -16
  57. package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_3_0_aar.xml +0 -16
  58. package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +0 -13
  59. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_3_0.xml +0 -11
  60. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +0 -13
  61. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_3_0_aar.xml +0 -13
  62. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_3_0_aar.xml +0 -13
  63. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_3_0_aar.xml +0 -13
  64. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_savedstate_2_3_0_aar.xml +0 -13
  65. package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +0 -13
  66. package/android/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_1_0_aar.xml +0 -13
  67. package/android/.idea/libraries/Gradle__androidx_test_core_1_2_0_aar.xml +0 -15
  68. package/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_2_0_aar.xml +0 -15
  69. package/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_2_0_aar.xml +0 -15
  70. package/android/.idea/libraries/Gradle__androidx_test_ext_junit_1_1_1_aar.xml +0 -15
  71. package/android/.idea/libraries/Gradle__androidx_test_monitor_1_2_0_aar.xml +0 -15
  72. package/android/.idea/libraries/Gradle__androidx_test_runner_1_2_0_aar.xml +0 -15
  73. package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml +0 -13
  74. package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml +0 -13
  75. package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml +0 -13
  76. package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +0 -13
  77. package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1.xml +0 -9
  78. package/android/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1.xml +0 -13
  79. package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml +0 -13
  80. package/android/.idea/libraries/Gradle__junit_junit_4_12.xml +0 -13
  81. package/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_1_10_18.xml +0 -13
  82. package/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_agent_1_10_18.xml +0 -13
  83. package/android/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0.xml +0 -13
  84. package/android/.idea/libraries/Gradle__org_apache_cordova_framework_7_0_0_aar.xml +0 -13
  85. package/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml +0 -13
  86. package/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3.xml +0 -13
  87. package/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3.xml +0 -13
  88. package/android/.idea/libraries/Gradle__org_json_json_20140107.xml +0 -13
  89. package/android/.idea/libraries/Gradle__org_mockito_mockito_core_3_6_28.xml +0 -13
  90. package/android/.idea/libraries/Gradle__org_mockito_mockito_inline_3_6_28.xml +0 -13
  91. package/android/.idea/libraries/Gradle__org_objenesis_objenesis_3_1.xml +0 -13
  92. package/android/.idea/misc.xml +0 -9
  93. package/android/.idea/modules/1586507569/android.capacitor-android.iml +0 -93
  94. package/android/.idea/modules/android.iml +0 -65
  95. package/android/.idea/modules.xml +0 -9
  96. package/android/.idea/vcs.xml +0 -6
  97. package/android/.npmignore +0 -1
  98. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  99. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  100. package/android/gradle.properties +0 -21
  101. package/android/gradlew +0 -160
  102. package/android/gradlew.bat +0 -90
  103. package/android/local.properties +0 -8
  104. package/android/proguard-rules.pro +0 -21
  105. package/android/settings.gradle +0 -2
  106. package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +0 -121
  107. package/android/src/main/res/layout/bridge_layout_main.xml +0 -15
  108. package/android/src/main/res/values/colors.xml +0 -3
  109. package/android/src/main/res/values/strings.xml +0 -3
  110. package/android/src/main/res/values/styles.xml +0 -3
  111. package/android/src/test/java/com/getcapacitor/ExampleUnitTest.java +0 -17
  112. package/ios/Plugin.xcodeproj/project.pbxproj +0 -735
  113. package/ios/Plugin.xcodeproj/xcshareddata/xcschemes/Plugin.xcscheme +0 -77
  114. package/ios/Plugin.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme +0 -88
  115. package/ios/Plugin.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/xcschememanagement.plist +0 -37
  116. package/ios/Plugin.xcworkspace/contents.xcworkspacedata +0 -10
  117. package/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  118. package/ios/Plugin.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -5
  119. package/ios/Plugin.xcworkspace/xcuserdata/mka.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  120. package/ios/Plugin.xcworkspace/xcuserdata/mka.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -24
  121. package/ios/PluginTests/Info.plist +0 -22
  122. package/ios/PluginTests/PluginTests.swift +0 -245
  123. package/ios/Podfile +0 -18
  124. package/ios/Podfile.lock +0 -29
  125. package/ios/Pods/CapacitorCordova/LICENSE +0 -23
  126. package/ios/Pods/CapacitorCordova/README.md +0 -37
  127. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/CapacitorCordova.h +0 -21
  128. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.h +0 -8
  129. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.m +0 -5
  130. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDV.h +0 -28
  131. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVAvailability.h +0 -109
  132. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegate.h +0 -51
  133. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.h +0 -39
  134. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.m +0 -154
  135. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.h +0 -31
  136. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.m +0 -81
  137. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.h +0 -52
  138. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.m +0 -116
  139. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.h +0 -81
  140. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.m +0 -154
  141. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.h +0 -25
  142. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.m +0 -77
  143. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.h +0 -82
  144. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.m +0 -216
  145. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVScreenOrientationDelegate.h +0 -33
  146. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.h +0 -41
  147. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.m +0 -399
  148. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.h +0 -27
  149. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.m +0 -74
  150. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.h +0 -27
  151. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.m +0 -156
  152. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.h +0 -30
  153. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.m +0 -34
  154. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.h +0 -35
  155. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.m +0 -63
  156. package/ios/Pods/Local Podspecs/Capacitor.podspec.json +0 -34
  157. package/ios/Pods/Local Podspecs/CapacitorCordova.podspec.json +0 -26
  158. package/ios/Pods/Manifest.lock +0 -29
  159. package/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -1512
  160. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/Capacitor.xcscheme +0 -58
  161. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/CapacitorCordova.xcscheme +0 -58
  162. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/Pods-Plugin.xcscheme +0 -58
  163. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme +0 -58
  164. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/SwiftKeychainWrapper.xcscheme +0 -58
  165. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/xcschememanagement.plist +0 -36
  166. package/ios/Pods/SwiftKeychainWrapper/LICENSE +0 -22
  167. package/ios/Pods/SwiftKeychainWrapper/README.md +0 -168
  168. package/ios/Pods/SwiftKeychainWrapper/SwiftKeychainWrapper/KeychainItemAccessibility.swift +0 -123
  169. package/ios/Pods/SwiftKeychainWrapper/SwiftKeychainWrapper/KeychainWrapper.swift +0 -447
  170. package/ios/Pods/SwiftKeychainWrapper/SwiftKeychainWrapper/SwiftKeychainWrapper.h +0 -37
  171. package/ios/Pods/Target Support Files/Capacitor/Capacitor-Info.plist +0 -26
  172. package/ios/Pods/Target Support Files/Capacitor/Capacitor-dummy.m +0 -5
  173. package/ios/Pods/Target Support Files/Capacitor/Capacitor-prefix.pch +0 -12
  174. package/ios/Pods/Target Support Files/Capacitor/Capacitor-umbrella.h +0 -23
  175. package/ios/Pods/Target Support Files/Capacitor/Capacitor.debug.xcconfig +0 -13
  176. package/ios/Pods/Target Support Files/Capacitor/Capacitor.modulemap +0 -7
  177. package/ios/Pods/Target Support Files/Capacitor/Capacitor.release.xcconfig +0 -13
  178. package/ios/Pods/Target Support Files/Capacitor/Capacitor.xcconfig +0 -10
  179. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-Info.plist +0 -26
  180. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-dummy.m +0 -5
  181. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-prefix.pch +0 -12
  182. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-umbrella.h +0 -33
  183. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.debug.xcconfig +0 -12
  184. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.modulemap +0 -6
  185. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.release.xcconfig +0 -12
  186. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.xcconfig +0 -9
  187. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-Info.plist +0 -26
  188. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.markdown +0 -83
  189. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.plist +0 -127
  190. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-dummy.m +0 -5
  191. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-umbrella.h +0 -16
  192. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig +0 -13
  193. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.modulemap +0 -6
  194. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig +0 -13
  195. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-Info.plist +0 -26
  196. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.markdown +0 -83
  197. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.plist +0 -127
  198. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-dummy.m +0 -5
  199. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh +0 -189
  200. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-umbrella.h +0 -16
  201. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig +0 -14
  202. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.modulemap +0 -6
  203. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig +0 -14
  204. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper-Info.plist +0 -26
  205. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper-dummy.m +0 -5
  206. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper-prefix.pch +0 -12
  207. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper-umbrella.h +0 -17
  208. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper.debug.xcconfig +0 -12
  209. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper.modulemap +0 -6
  210. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper.release.xcconfig +0 -12
  211. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper.xcconfig +0 -9
  212. package/ios/TestApp/AppDelegate.swift +0 -37
  213. package/ios/TestApp/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  214. package/ios/TestApp/Assets.xcassets/Contents.json +0 -6
  215. package/ios/TestApp/Base.lproj/LaunchScreen.storyboard +0 -25
  216. package/ios/TestApp/Base.lproj/Main.storyboard +0 -24
  217. package/ios/TestApp/ContentView.swift +0 -21
  218. package/ios/TestApp/Info.plist +0 -60
  219. package/ios/TestApp/Preview Content/Preview Assets.xcassets/Contents.json +0 -6
  220. package/ios/TestApp/SceneDelegate.swift +0 -64
  221. package/ios/TestApp/TestApp/AppDelegate.swift +0 -46
  222. package/ios/TestApp/TestApp/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  223. package/ios/TestApp/TestApp/Assets.xcassets/Contents.json +0 -6
  224. package/ios/TestApp/TestApp/Base.lproj/LaunchScreen.storyboard +0 -25
  225. package/ios/TestApp/TestApp/Base.lproj/Main.storyboard +0 -24
  226. package/ios/TestApp/TestApp/Info.plist +0 -45
  227. package/ios/TestApp/TestApp/TestApp.entitlements +0 -10
  228. package/ios/TestApp/TestApp/ViewController.swift +0 -20
  229. package/ios/TestApp/TestApp.entitlements +0 -8
  230. package/ios/TestApp/ViewController.swift +0 -20
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "1250"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForTesting = "YES"
11
- buildForRunning = "YES"
12
- buildForProfiling = "YES"
13
- buildForArchiving = "YES"
14
- buildForAnalyzing = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "0ECF3D6BFCC08377AE23B027EE1D4371"
18
- BuildableName = "Capacitor.framework"
19
- BlueprintName = "Capacitor"
20
- ReferencedContainer = "container:Pods.xcodeproj">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- buildConfiguration = "Debug"
27
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
30
- <Testables>
31
- </Testables>
32
- </TestAction>
33
- <LaunchAction
34
- buildConfiguration = "Debug"
35
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
- launchStyle = "0"
38
- useCustomWorkingDirectory = "NO"
39
- ignoresPersistentStateOnLaunch = "NO"
40
- debugDocumentVersioning = "YES"
41
- debugServiceExtension = "internal"
42
- allowLocationSimulation = "YES">
43
- </LaunchAction>
44
- <ProfileAction
45
- buildConfiguration = "Release"
46
- shouldUseLaunchSchemeArgsEnv = "YES"
47
- savedToolIdentifier = ""
48
- useCustomWorkingDirectory = "NO"
49
- debugDocumentVersioning = "YES">
50
- </ProfileAction>
51
- <AnalyzeAction
52
- buildConfiguration = "Debug">
53
- </AnalyzeAction>
54
- <ArchiveAction
55
- buildConfiguration = "Release"
56
- revealArchiveInOrganizer = "YES">
57
- </ArchiveAction>
58
- </Scheme>
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "1250"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForTesting = "YES"
11
- buildForRunning = "YES"
12
- buildForProfiling = "YES"
13
- buildForArchiving = "YES"
14
- buildForAnalyzing = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "400AE44335852A2D8D746557E21E8EB0"
18
- BuildableName = "Cordova.framework"
19
- BlueprintName = "CapacitorCordova"
20
- ReferencedContainer = "container:Pods.xcodeproj">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- buildConfiguration = "Debug"
27
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
30
- <Testables>
31
- </Testables>
32
- </TestAction>
33
- <LaunchAction
34
- buildConfiguration = "Debug"
35
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
- launchStyle = "0"
38
- useCustomWorkingDirectory = "NO"
39
- ignoresPersistentStateOnLaunch = "NO"
40
- debugDocumentVersioning = "YES"
41
- debugServiceExtension = "internal"
42
- allowLocationSimulation = "YES">
43
- </LaunchAction>
44
- <ProfileAction
45
- buildConfiguration = "Release"
46
- shouldUseLaunchSchemeArgsEnv = "YES"
47
- savedToolIdentifier = ""
48
- useCustomWorkingDirectory = "NO"
49
- debugDocumentVersioning = "YES">
50
- </ProfileAction>
51
- <AnalyzeAction
52
- buildConfiguration = "Debug">
53
- </AnalyzeAction>
54
- <ArchiveAction
55
- buildConfiguration = "Release"
56
- revealArchiveInOrganizer = "YES">
57
- </ArchiveAction>
58
- </Scheme>
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "1250"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForTesting = "YES"
11
- buildForRunning = "YES"
12
- buildForProfiling = "YES"
13
- buildForArchiving = "YES"
14
- buildForAnalyzing = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "10467BF5021453A5297325418ACC4E64"
18
- BuildableName = "Pods_Plugin.framework"
19
- BlueprintName = "Pods-Plugin"
20
- ReferencedContainer = "container:Pods.xcodeproj">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- buildConfiguration = "Debug"
27
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
30
- <Testables>
31
- </Testables>
32
- </TestAction>
33
- <LaunchAction
34
- buildConfiguration = "Debug"
35
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
- launchStyle = "0"
38
- useCustomWorkingDirectory = "NO"
39
- ignoresPersistentStateOnLaunch = "NO"
40
- debugDocumentVersioning = "YES"
41
- debugServiceExtension = "internal"
42
- allowLocationSimulation = "YES">
43
- </LaunchAction>
44
- <ProfileAction
45
- buildConfiguration = "Release"
46
- shouldUseLaunchSchemeArgsEnv = "YES"
47
- savedToolIdentifier = ""
48
- useCustomWorkingDirectory = "NO"
49
- debugDocumentVersioning = "YES">
50
- </ProfileAction>
51
- <AnalyzeAction
52
- buildConfiguration = "Debug">
53
- </AnalyzeAction>
54
- <ArchiveAction
55
- buildConfiguration = "Release"
56
- revealArchiveInOrganizer = "YES">
57
- </ArchiveAction>
58
- </Scheme>
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "1250"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForTesting = "YES"
11
- buildForRunning = "YES"
12
- buildForProfiling = "YES"
13
- buildForArchiving = "YES"
14
- buildForAnalyzing = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "401C34F4B17A319A7086C93431C92B42"
18
- BuildableName = "Pods_PluginTests.framework"
19
- BlueprintName = "Pods-PluginTests"
20
- ReferencedContainer = "container:Pods.xcodeproj">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- buildConfiguration = "Debug"
27
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
30
- <Testables>
31
- </Testables>
32
- </TestAction>
33
- <LaunchAction
34
- buildConfiguration = "Debug"
35
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
- launchStyle = "0"
38
- useCustomWorkingDirectory = "NO"
39
- ignoresPersistentStateOnLaunch = "NO"
40
- debugDocumentVersioning = "YES"
41
- debugServiceExtension = "internal"
42
- allowLocationSimulation = "YES">
43
- </LaunchAction>
44
- <ProfileAction
45
- buildConfiguration = "Release"
46
- shouldUseLaunchSchemeArgsEnv = "YES"
47
- savedToolIdentifier = ""
48
- useCustomWorkingDirectory = "NO"
49
- debugDocumentVersioning = "YES">
50
- </ProfileAction>
51
- <AnalyzeAction
52
- buildConfiguration = "Debug">
53
- </AnalyzeAction>
54
- <ArchiveAction
55
- buildConfiguration = "Release"
56
- revealArchiveInOrganizer = "YES">
57
- </ArchiveAction>
58
- </Scheme>
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "1250"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForTesting = "YES"
11
- buildForRunning = "YES"
12
- buildForProfiling = "YES"
13
- buildForArchiving = "YES"
14
- buildForAnalyzing = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "CF903DF43E111410ECA0C288D36FA21A"
18
- BuildableName = "SwiftKeychainWrapper.framework"
19
- BlueprintName = "SwiftKeychainWrapper"
20
- ReferencedContainer = "container:Pods.xcodeproj">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- buildConfiguration = "Debug"
27
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
30
- <Testables>
31
- </Testables>
32
- </TestAction>
33
- <LaunchAction
34
- buildConfiguration = "Debug"
35
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
- launchStyle = "0"
38
- useCustomWorkingDirectory = "NO"
39
- ignoresPersistentStateOnLaunch = "NO"
40
- debugDocumentVersioning = "YES"
41
- debugServiceExtension = "internal"
42
- allowLocationSimulation = "YES">
43
- </LaunchAction>
44
- <ProfileAction
45
- buildConfiguration = "Release"
46
- shouldUseLaunchSchemeArgsEnv = "YES"
47
- savedToolIdentifier = ""
48
- useCustomWorkingDirectory = "NO"
49
- debugDocumentVersioning = "YES">
50
- </ProfileAction>
51
- <AnalyzeAction
52
- buildConfiguration = "Debug">
53
- </AnalyzeAction>
54
- <ArchiveAction
55
- buildConfiguration = "Release"
56
- revealArchiveInOrganizer = "YES">
57
- </ArchiveAction>
58
- </Scheme>
@@ -1,36 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>SchemeUserState</key>
6
- <dict>
7
- <key>Capacitor.xcscheme</key>
8
- <dict>
9
- <key>isShown</key>
10
- <false/>
11
- </dict>
12
- <key>CapacitorCordova.xcscheme</key>
13
- <dict>
14
- <key>isShown</key>
15
- <false/>
16
- </dict>
17
- <key>Pods-Plugin.xcscheme</key>
18
- <dict>
19
- <key>isShown</key>
20
- <false/>
21
- </dict>
22
- <key>Pods-PluginTests.xcscheme</key>
23
- <dict>
24
- <key>isShown</key>
25
- <false/>
26
- </dict>
27
- <key>SwiftKeychainWrapper.xcscheme</key>
28
- <dict>
29
- <key>isShown</key>
30
- <false/>
31
- </dict>
32
- </dict>
33
- <key>SuppressBuildableAutocreation</key>
34
- <dict/>
35
- </dict>
36
- </plist>
@@ -1,22 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Jason Rendel
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
@@ -1,168 +0,0 @@
1
- # SwiftKeychainWrapper
2
-
3
- A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift.
4
-
5
- Provides singleton instance that is setup to work for most needs. Use `KeychainWrapper.standard` to access the singleton instance.
6
-
7
- If you need to customize the keychain access to use a custom identifier or access group, you can create your own instance instead of using the singleton instance.
8
-
9
- By default, the Keychain Wrapper saves data as a Generic Password type in the iOS Keychain. It saves items such that they can only be accessed when the app is unlocked and open. If you are not familiar with the iOS Keychain usage, this provides a safe default for using the keychain.
10
-
11
- Users that want to deviate from this default implementation, now can do so in in version 2.0 and up. Each request to save/read a key value now allows you to specify the keychain accessibility for that key.
12
-
13
- ## General Usage
14
-
15
- Add a string value to keychain:
16
- ``` swift
17
- let saveSuccessful: Bool = KeychainWrapper.standard.set("Some String", forKey: "myKey")
18
- ```
19
-
20
- Retrieve a string value from keychain:
21
- ``` swift
22
- let retrievedString: String? = KeychainWrapper.standard.string(forKey: "myKey")
23
- ```
24
-
25
- Remove a string value from keychain:
26
- ``` swift
27
- let removeSuccessful: Bool = KeychainWrapper.standard.removeObject(forKey: "myKey")
28
- ```
29
-
30
- ## Custom Instance
31
-
32
- When the Keychain Wrapper is used, all keys are linked to a common identifier for your app, called the service name. By default this uses your main bundle identifier. However, you may also change it, or store multiple items to the keycahin under different identifiers.
33
-
34
- To share keychain items between your applications, you may specify an access group and use that same access group in each application.
35
-
36
- To set a custom service name identifier or access group, you may now create your own instance of the keychain wrapper as follows:
37
-
38
- ``` swift
39
- let uniqueServiceName = "customServiceName"
40
- let uniqueAccessGroup = "sharedAccessGroupName"
41
- let customKeychainWrapperInstance = KeychainWrapper(serviceName: uniqueServiceName, accessGroup: uniqueAccessGroup)
42
- ```
43
- The custom instance can then be used in place of the shared instance or static accessors:
44
-
45
- ``` swift
46
- let saveSuccessful: Bool = customKeychainWrapperInstance.set("Some String", forKey: "myKey")
47
-
48
- let retrievedString: String? = customKeychainWrapperInstance.string(forKey: "myKey")
49
-
50
- let removeSuccessful: Bool = customKeychainWrapperInstance.removeObject(forKey: "myKey")
51
- ```
52
-
53
- ## Accessibility Options
54
-
55
- By default, all items saved to keychain can only be accessed when the device is unlocked. To change this accessibility, an optional `withAccessibility` param can be set on all requests. The enum `KeychainItemAccessibilty` provides an easy way to select the accessibility level desired:
56
-
57
- ``` swift
58
- KeychainWrapper.standard.set("Some String", forKey: "myKey", withAccessibility: .AfterFirstUnlock)
59
- ```
60
-
61
- ## Installation
62
-
63
- #### CocoaPods
64
- You can use [CocoaPods](http://cocoapods.org/) to install SwiftKeychainWrapper by adding it to your `Podfile`:
65
-
66
- ``` ruby
67
- use_frameworks!
68
- platform :ios, '8.0'
69
-
70
- target 'target_name' do
71
- pod 'SwiftKeychainWrapper'
72
- end
73
- ```
74
-
75
- To use the keychain wrapper in your app, import SwiftKeychainWrapper into the file(s) where you want to use it.
76
-
77
- ``` swift
78
- import SwiftKeychainWrapper
79
- ```
80
-
81
- #### Carthage
82
- You can use [Carthage](https://github.com/Carthage/Carthage) to install SwiftKeychainWrapper by adding it to your `Cartfile`.
83
-
84
- Swift 3.0:
85
- ```
86
- github "jrendel/SwiftKeychainWrapper" ~> 3.0
87
- ```
88
-
89
- Swift 2.3:
90
- ```
91
- github "jrendel/SwiftKeychainWrapper" == 2.1.1
92
- ```
93
-
94
- #### Manually
95
- Download and drop ```KeychainWrapper.swift``` and ```KeychainItemAcessibility.swift``` into your project.
96
-
97
-
98
- ## Release History
99
-
100
- * 3.4
101
- * Changed how Swift version is defined for CocoaPods
102
-
103
- * 3.3
104
- * Updates for Swift 5.0 and Xcode 10.2
105
-
106
- * 3.2
107
- * Updates for Swift 4.2 and Xcode 10
108
-
109
- * 3.1
110
- * Updates for Swift 3.1
111
-
112
- * 3.0.1
113
- * Added a host app for the unit tests to get around the issue with keychain access not working the same on iOS 10 simulators
114
- * Minor update to readme instructions
115
-
116
- * 3.0
117
- * Swift 3.0 update. Contains breaking API changes. 2.2.0 and 2.2.1 are now rolled into 3.0
118
-
119
- * 2.2.1 (Removed from Cocoapods)
120
- * Syntax updates to be more Swift 3 like
121
-
122
- * 2.2 (Removed from Cocoapods)
123
- * Updated to support Swift 3.0
124
- * Remove deprecated functions (static access)
125
-
126
- * 2.1
127
- * Updated to support Swift 2.3
128
-
129
- * 2.0
130
- * Further changes to more closely align the API with how `NSUserDefaults` works. Access to the default implementation is now done through a singleton instance. Static accessors have been included that wrap this shared instance to maintain backwards compatibility. These will be removed in the next update
131
- * Ability to change keychain service name identifier and access group on the shared instance has been deprecated. Users now have the ability to create their own instance of the keychain if they want to customize these.
132
- * Addtional options have been provided to alter the keychain accessibility for each key value saved.
133
-
134
- * 1.0.11
135
- * Update for Swift 2.0
136
-
137
- * 1.0.10
138
- * Update License info. Merged Pull Request with Carthage support.
139
-
140
- * 1.0.8
141
- * Update for Swift 1.2
142
-
143
- * 1.0.7
144
- * Determined that once provisioned correctly for access groups, using KeychainWrapper on the simulator with access groups works. So I removed the simulator related check and unit tests previously added.
145
-
146
- * 1.0.6
147
- * Support for Access Groups
148
- * SwiftKeychainWrapperExample has been updated to show usage with an Access Group: https://github.com/jrendel/SwiftKeychainWrapperExample
149
-
150
- * Access Groups do not work on the simulator. Apps that are built for the simulator aren't signed, so there's no keychain access group for the simulator to check. This means that all apps can see all keychain items when run on the simulator. Attempting to set an access group will result in a failure when attempting to Add or Update keychain items. Because of this, the Keychain Wrapper detects if it is being using on a simulator and will not set an access group property if one is set. This allows the Keychain Wrapper to still be used on the simulator for development of your app. To properly test Keychain Access Groups, you will need to test on a device.
151
-
152
- * 1.0.5
153
- * This version converts the project to a proper Swift Framework and adds a podspec file to be compatible with the latest CocoaPods pre-release, which now supports Swift.
154
-
155
- * To see an example of usage with CocoaPods, I've created the repo SwiftKeychainWrapperExample: https://github.com/jrendel/SwiftKeychainWrapperExample
156
-
157
- * 1.0.2
158
- * Updated for Xcode 6.1
159
-
160
- ---
161
-
162
- I've been using an Objective-C based wrapper in my own projects for the past couple years. The original library I wrote for myself was based on the following tutorial:
163
-
164
- http://www.raywenderlich.com/6475/basic-security-in-ios-5-tutorial-part-1
165
-
166
- This is a rewrite of that code in Swift.
167
-
168
- [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
@@ -1,123 +0,0 @@
1
- //
2
- // KeychainOptions.swift
3
- // SwiftKeychainWrapper
4
- //
5
- // Created by James Blair on 4/24/16.
6
- // Copyright © 2016 Jason Rendel. All rights reserved.
7
- //
8
- // The MIT License (MIT)
9
- //
10
- // Permission is hereby granted, free of charge, to any person obtaining a copy
11
- // of this software and associated documentation files (the "Software"), to deal
12
- // in the Software without restriction, including without limitation the rights
13
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- // copies of the Software, and to permit persons to whom the Software is
15
- // furnished to do so, subject to the following conditions:
16
- //
17
- // The above copyright notice and this permission notice shall be included in all
18
- // copies or substantial portions of the Software.
19
- //
20
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- // SOFTWARE.
27
-
28
- import Foundation
29
-
30
- protocol KeychainAttrRepresentable {
31
- var keychainAttrValue: CFString { get }
32
- }
33
-
34
- // MARK: - KeychainItemAccessibility
35
- public enum KeychainItemAccessibility {
36
- /**
37
- The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user.
38
-
39
- After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute migrate to a new device when using encrypted backups.
40
- */
41
- @available(iOS 4, *)
42
- case afterFirstUnlock
43
-
44
- /**
45
- The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user.
46
-
47
- After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.
48
- */
49
- @available(iOS 4, *)
50
- case afterFirstUnlockThisDeviceOnly
51
-
52
- /**
53
- The data in the keychain item can always be accessed regardless of whether the device is locked.
54
-
55
- This is not recommended for application use. Items with this attribute migrate to a new device when using encrypted backups.
56
- */
57
- @available(iOS 4, *)
58
- case always
59
-
60
- /**
61
- The data in the keychain can only be accessed when the device is unlocked. Only available if a passcode is set on the device.
62
-
63
- This is recommended for items that only need to be accessible while the application is in the foreground. Items with this attribute never migrate to a new device. After a backup is restored to a new device, these items are missing. No items can be stored in this class on devices without a passcode. Disabling the device passcode causes all items in this class to be deleted.
64
- */
65
- @available(iOS 8, *)
66
- case whenPasscodeSetThisDeviceOnly
67
-
68
- /**
69
- The data in the keychain item can always be accessed regardless of whether the device is locked.
70
-
71
- This is not recommended for application use. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.
72
- */
73
- @available(iOS 4, *)
74
- case alwaysThisDeviceOnly
75
-
76
- /**
77
- The data in the keychain item can be accessed only while the device is unlocked by the user.
78
-
79
- This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute migrate to a new device when using encrypted backups.
80
-
81
- This is the default value for keychain items added without explicitly setting an accessibility constant.
82
- */
83
- @available(iOS 4, *)
84
- case whenUnlocked
85
-
86
- /**
87
- The data in the keychain item can be accessed only while the device is unlocked by the user.
88
-
89
- This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.
90
- */
91
- @available(iOS 4, *)
92
- case whenUnlockedThisDeviceOnly
93
-
94
- static func accessibilityForAttributeValue(_ keychainAttrValue: CFString) -> KeychainItemAccessibility? {
95
- for (key, value) in keychainItemAccessibilityLookup {
96
- if value == keychainAttrValue {
97
- return key
98
- }
99
- }
100
-
101
- return nil
102
- }
103
- }
104
-
105
- private let keychainItemAccessibilityLookup: [KeychainItemAccessibility:CFString] = {
106
- var lookup: [KeychainItemAccessibility:CFString] = [
107
- .afterFirstUnlock: kSecAttrAccessibleAfterFirstUnlock,
108
- .afterFirstUnlockThisDeviceOnly: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly,
109
- .always: kSecAttrAccessibleAlways,
110
- .whenPasscodeSetThisDeviceOnly: kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly,
111
- .alwaysThisDeviceOnly : kSecAttrAccessibleAlwaysThisDeviceOnly,
112
- .whenUnlocked: kSecAttrAccessibleWhenUnlocked,
113
- .whenUnlockedThisDeviceOnly: kSecAttrAccessibleWhenUnlockedThisDeviceOnly
114
- ]
115
-
116
- return lookup
117
- }()
118
-
119
- extension KeychainItemAccessibility : KeychainAttrRepresentable {
120
- internal var keychainAttrValue: CFString {
121
- return keychainItemAccessibilityLookup[self]!
122
- }
123
- }