Skip to content
Snippets Groups Projects
Commit e6837c65 authored by jakobsbode's avatar jakobsbode
Browse files

Conversion in progress

parent 4183e751
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ target 'enzevalos_iphone' do
#pod 'ObjectivePGP'
pod 'OpenSSL-Universal'
pod 'BZipCompression'
pod 'KeychainAccess', '~> 2.4'
pod 'KeychainAccess'#, '~> 2.4'
pod 'Onboard'
target 'enzevalos_iphoneTests' do
......
PODS:
- BZipCompression (1.0.2)
- FrameAccessor (1.3.2)
- KeychainAccess (2.4.0)
- KeychainAccess (3.0.2)
- mailcore2-ios (0.6.4)
- Onboard (2.3.1)
- OpenSSL-Universal (1.0.1.20)
......@@ -10,7 +10,7 @@ PODS:
DEPENDENCIES:
- BZipCompression
- KeychainAccess (~> 2.4)
- KeychainAccess
- mailcore2-ios
- Onboard
- OpenSSL-Universal
......@@ -19,12 +19,12 @@ DEPENDENCIES:
SPEC CHECKSUMS:
BZipCompression: e0f96508e60eb93b5f5d4c7de1eb3dd0ac4f9ae9
FrameAccessor: 0f7ba6ce37be9a5d0302a27c731dca70af8d438b
KeychainAccess: c2a71459af5bddf720a51806046a598500976c04
KeychainAccess: a986406022dfc7c634c691ad3bec670cc6a32002
mailcore2-ios: 3ff0be2fa553d4da9c11d39c11d51863c768f24f
Onboard: b6871f25ac753175b2ab9a362fb2feb26a81a311
OpenSSL-Universal: 71f2c4b2ae758e2218090f905e95ca0ac5c01be7
VENTokenField: 5a19b838fb97f040e3d4c93f584b4adeaf3fc1ee
PODFILE CHECKSUM: 4991d462e1331cd4544d402d5e14432ef470f0f9
PODFILE CHECKSUM: d91a8bb487191b547b9ddc6870d3067a9a2cbe8b
COCOAPODS: 1.0.1
This diff is collapsed.
# KeychainAccess
[![CI Status](http://img.shields.io/travis/kishikawakatsumi/KeychainAccess.svg?style=flat)](https://travis-ci.org/kishikawakatsumi/KeychainAccess)
[![Coverage Status](https://coveralls.io/repos/kishikawakatsumi/KeychainAccess/badge.svg?branch=master&service=github)](https://coveralls.io/github/kishikawakatsumi/KeychainAccess?branch=master)
[![CI Status](http://img.shields.io/travis/kishikawakatsumi/KeychainAccess.svg)](https://travis-ci.org/kishikawakatsumi/KeychainAccess)
[![Coverage Status](https://img.shields.io/coveralls/kishikawakatsumi/KeychainAccess.svg)](https://coveralls.io/github/kishikawakatsumi/KeychainAccess?branch=master)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/KeychainAccess.svg?style=flat)](http://cocoadocs.org/docsets/KeychainAccess)
[![Platform](https://img.shields.io/cocoapods/p/KeychainAccess.svg?style=flat)](http://cocoadocs.org/docsets/KeychainAccess)
[![Version](https://img.shields.io/cocoapods/v/KeychainAccess.svg)](http://cocoadocs.org/docsets/KeychainAccess)
[![Platform](https://img.shields.io/cocoapods/p/KeychainAccess.svg)](http://cocoadocs.org/docsets/KeychainAccess)
KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much more palatable to use in Swift.
......@@ -21,6 +21,7 @@ KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X
- **[Support Shared Web Credentials (iOS 8+)](#shared_web_credentials)**
- [Works on both iOS & OS X](#requirements)
- [watchOS and tvOS are supported](#requirements)
- **[Swift 3 & Swift 2.3 compatible](#requirements)**
## :book: Usage
......@@ -40,7 +41,7 @@ keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
#### Saving Internet Password
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS)
let keychain = Keychain(server: "https://github.com", protocolType: .https)
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
......@@ -59,11 +60,11 @@ let keychain = Keychain(service: "com.example.github-token", accessGroup: "12ABC
#### Create Keychain for Internet Password
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS)
let keychain = Keychain(server: "https://github.com", protocolType: .https)
```
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS, authenticationType: .HTMLForm)
let keychain = Keychain(server: "https://github.com", protocolType: .https, authenticationType: .htmlForm)
```
### :key: Adding an item
......@@ -162,7 +163,7 @@ do {
### :key: Set Label and Comment
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS)
let keychain = Keychain(server: "https://github.com", protocolType: .https)
do {
try keychain
.label("github.com (kishikawakatsumi)")
......@@ -224,7 +225,7 @@ print(attributes.creator)
let keychain = Keychain(service: "com.example.github-token")
.label("github.com (kishikawakatsumi)")
.synchronizable(true)
.accessibility(.AfterFirstUnlock)
.accessibility(.afterFirstUnlock)
```
#### <a name="accessibility"> Accessibility
......@@ -241,7 +242,7 @@ let keychain = Keychain(service: "com.example.github-token")
```swift
let keychain = Keychain(service: "com.example.github-token")
.accessibility(.AfterFirstUnlock)
.accessibility(.afterFirstUnlock)
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
......@@ -253,7 +254,7 @@ let keychain = Keychain(service: "com.example.github-token")
do {
try keychain
.accessibility(.AfterFirstUnlock)
.accessibility(.afterFirstUnlock)
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
print("error: \(error)")
......@@ -266,7 +267,7 @@ do {
```swift
let keychain = Keychain(service: "com.example.github-token")
.accessibility(.WhenUnlocked)
.accessibility(.whenUnlocked)
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
......@@ -278,7 +279,7 @@ let keychain = Keychain(service: "com.example.github-token")
do {
try keychain
.accessibility(.WhenUnlocked)
.accessibility(.whenUnlocked)
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
print("error: \(error)")
......@@ -328,11 +329,11 @@ If you want to store the Touch ID protected Keychain item, specify `accessibilit
```swift
let keychain = Keychain(service: "com.example.github-token")
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
DispatchQueue.global().async {
do {
// Should be the secret invalidated when passcode is removed? If not then use `.WhenUnlocked`
try keychain
.accessibility(.WhenPasscodeSetThisDeviceOnly, authenticationPolicy: .UserPresence)
.accessibility(.whenPasscodeSetThisDeviceOnly, authenticationPolicy: .userPresence)
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
// Error handling if needed...
......@@ -353,11 +354,11 @@ If the item not protected, the `authenticationPrompt` parameter just be ignored.
```swift
let keychain = Keychain(service: "com.example.github-token")
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
DispatchQueue.global().async {
do {
// Should be the secret invalidated when passcode is removed? If not then use `.WhenUnlocked`
try keychain
.accessibility(.WhenPasscodeSetThisDeviceOnly, authenticationPolicy: .UserPresence)
.accessibility(.whenPasscodeSetThisDeviceOnly, authenticationPolicy: .userPresence)
.authenticationPrompt("Authenticate to update your access token")
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
......@@ -375,7 +376,7 @@ If the item not protected, the `authenticationPrompt` parameter just be ignored.
```swift
let keychain = Keychain(service: "com.example.github-token")
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
DispatchQueue.global().async {
do {
let password = try keychain
.authenticationPrompt("Authenticate to login to server")
......@@ -476,23 +477,23 @@ let password = Keychain.generatePassword() // => Nhu-GKm-s3n-pMx
#### Display all stored items if print keychain object
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS)
let keychain = Keychain(server: "https://github.com", protocolType: .https)
print("\(keychain)")
```
```
=>
[
[authenticationType: Default, key: kishikawakatsumi, server: github.com, class: InternetPassword, protocol: HTTPS]
[authenticationType: Default, key: hirohamada, server: github.com, class: InternetPassword, protocol: HTTPS]
[authenticationType: Default, key: honeylemon, server: github.com, class: InternetPassword, protocol: HTTPS]
[authenticationType: default, key: kishikawakatsumi, server: github.com, class: internetPassword, protocol: https]
[authenticationType: default, key: hirohamada, server: github.com, class: internetPassword, protocol: https]
[authenticationType: default, key: honeylemon, server: github.com, class: internetPassword, protocol: https]
]
```
#### Obtaining all stored keys
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS)
let keychain = Keychain(server: "https://github.com", protocolType: .https)
let keys = keychain.allKeys()
for key in keys {
......@@ -510,7 +511,7 @@ key: honeylemon
#### Obtaining all stored items
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .HTTPS)
let keychain = Keychain(server: "https://github.com", protocolType: .https)
let items = keychain.allItems()
for item in items {
......@@ -520,20 +521,23 @@ for item in items {
```
=>
item: [authenticationType: Default, key: kishikawakatsumi, server: github.com, class: InternetPassword, protocol: HTTPS]
item: [authenticationType: Default, key: hirohamada, server: github.com, class: InternetPassword, protocol: HTTPS]
item: [authenticationType: Default, key: honeylemon, server: github.com, class: InternetPassword, protocol: HTTPS]
item: [authenticationType: Default, key: kishikawakatsumi, server: github.com, class: InternetPassword, protocol: https]
item: [authenticationType: Default, key: hirohamada, server: github.com, class: InternetPassword, protocol: https]
item: [authenticationType: Default, key: honeylemon, server: github.com, class: InternetPassword, protocol: https]
```
## Requirements
| | OS | Swift |
|--------|----------------------------------|----------|
| **v1.1.x** | iOS 7+, OSX 10.9+ | 1.1 |
| **v1.2.x** | iOS 7+, OSX 10.9+ | 1.2 |
| **v2.0.x** | iOS 7+, OSX 10.9+, watchOS | 2.0 |
| **v2.1.x** | iOS 7+, OSX 10.9+, watchOS | 2.0 |
| **v2.2.x** | iOS 8+, OSX 10.9+, watchOS, tvOS | 2.0, 2.1 |
| | OS | Swift |
|------------|----------------------------------------|---------------|
| **v1.1.x** | iOS 7+, OSX 10.9+ | 1.1 |
| **v1.2.x** | iOS 7+, OSX 10.9+ | 1.2 |
| **v2.0.x** | iOS 7+, OSX 10.9+, watchOS 2+ | 2.0 |
| **v2.1.x** | iOS 7+, OSX 10.9+, watchOS 2+ | 2.0 |
| **v2.2.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.0, 2.1 |
| **v2.3.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.0, 2.1, 2.2 |
| **v2.4.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.2, 2.3 |
| **v3.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 3.0 |
## Installation
......
PODS:
- BZipCompression (1.0.2)
- FrameAccessor (1.3.2)
- KeychainAccess (2.4.0)
- KeychainAccess (3.0.2)
- mailcore2-ios (0.6.4)
- Onboard (2.3.1)
- OpenSSL-Universal (1.0.1.20)
......@@ -10,7 +10,7 @@ PODS:
DEPENDENCIES:
- BZipCompression
- KeychainAccess (~> 2.4)
- KeychainAccess
- mailcore2-ios
- Onboard
- OpenSSL-Universal
......@@ -19,12 +19,12 @@ DEPENDENCIES:
SPEC CHECKSUMS:
BZipCompression: e0f96508e60eb93b5f5d4c7de1eb3dd0ac4f9ae9
FrameAccessor: 0f7ba6ce37be9a5d0302a27c731dca70af8d438b
KeychainAccess: c2a71459af5bddf720a51806046a598500976c04
KeychainAccess: a986406022dfc7c634c691ad3bec670cc6a32002
mailcore2-ios: 3ff0be2fa553d4da9c11d39c11d51863c768f24f
Onboard: b6871f25ac753175b2ab9a362fb2feb26a81a311
OpenSSL-Universal: 71f2c4b2ae758e2218090f905e95ca0ac5c01be7
VENTokenField: 5a19b838fb97f040e3d4c93f584b4adeaf3fc1ee
PODFILE CHECKSUM: 4991d462e1331cd4544d402d5e14432ef470f0f9
PODFILE CHECKSUM: d91a8bb487191b547b9ddc6870d3067a9a2cbe8b
COCOAPODS: 1.0.1
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.4.0</string>
<string>3.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -7,4 +7,4 @@ PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATF
PODS_ROOT = ${SRCROOT}
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
SWIFT_VERSION = 2.3
SWIFT_VERSION = 3.0
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment