UICKeyChainStore is a simple wrapper for Keychain on iOS, watchOS, tvOS and macOS. Makes using Keychain APIs as easy as NSUserDefaults.

Overview

UICKeyChainStore

CI Status Coverage Status Carthage compatible Version License Platform

UICKeyChainStore is a simple wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs as easy as NSUserDefaults.

Looking for the library written in Swift?

Try KeychainAccess.
KeychainAccess is next generation of UICKeyChainStore.

Transitioning from 1.x to 2.0

synchronize method is deprecated. Calling this method is no longer required (Just ignored).

Features

Usage

Basics

Saving Application Password

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];
keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef";

Saving Internet Password

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com"]
                                                          protocolType:UICKeyChainStoreProtocolTypeHTTPS];
keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef";

Instantiation

Create Keychain for Application Password

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];
UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"kishikawakatsumi.git"
                                                            accessGroup:@"12ABCD3E4F.shared"];

Create Keychain for Internet Password

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com"]
                                                          protocolType:UICKeyChainStoreProtocolTypeHTTPS];
UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com"]
                                                          protocolType:UICKeyChainStoreProtocolTypeHTTPS
                                                    authenticationType:UICKeyChainStoreAuthenticationTypeHTMLForm];

Adding an item

subscripting

keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef"

set method

[keychain setString:@"01234567-89ab-cdef-0123-456789abcdef" forKey:@"kishikawakatsumi"];

error handling

if (![keychain setString:@"01234567-89ab-cdef-0123-456789abcdef" forKey:@"kishikawakatsumi"]) {
    // error has occurred
}
NSError *error;
[keychain setString:@"01234567-89ab-cdef-0123-456789abcdef" forKey:@"kishikawakatsumi" error:&error];
if (error) {
    NSLog(@"%@", error.localizedDescription);
}

Obtaining an item

subscripting (automatically converts to string)

NSString *token = keychain[@"kishikawakatsumi"]

get methods

as String
NSString *token = [keychain stringForKey:@"kishikawakatsumi"];
as NSData
NSData *data = [keychain dataForKey:@"kishikawakatsumi"];

error handling

First, get the failable (value or error) object

NSError *error;
NSString *token = [keychain stringForKey:@"" error:&error];
if (error) {
    NSLog(@"%@", error.localizedDescription);
}

Removing an item

subscripting

keychain[@"kishikawakatsumi"] = nil

remove method

[keychain removeItemForKey:@"kishikawakatsumi"];

error handling

if (![keychain removeItemForKey:@"kishikawakatsumi"]) {
    // error has occurred
}
NSError *error;
[keychain removeItemForKey:@"kishikawakatsumi" error:&error];
if (error) {
    NSLog(@"%@", error.localizedDescription);
}

Label and Comment

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com"]
                                                          protocolType:UICKeyChainStoreProtocolTypeHTTPS];
[keychain setString:@"01234567-89ab-cdef-0123-456789abcdef"
             forKey:@"kishikawakatsumi"
              label:@"github.com (kishikawakatsumi)"
            comment:@"github access token"];

Configuration (Accessibility, Sharing, iCould Sync)

Accessibility

Default accessibility matches background application (=kSecAttrAccessibleAfterFirstUnlock)
UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];
For background application
Creating instance
UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];
keychain.accessibility = UICKeyChainStoreAccessibilityAfterFirstUnlock;

keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef"
For foreground application
Creating instance
UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];
keychain.accessibility = UICKeyChainStoreAccessibilityWhenUnlocked;

keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef"

Sharing Keychain items

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"kishikawakatsumi.git"
                                                            accessGroup:@"12ABCD3E4F.shared"];

Synchronizing Keychain items with iCloud

Creating instance
UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];
keychain.synchronizable = YES;

keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef"

Touch ID integration

Any Operation that require authentication must be run in the background thread.
If you run in the main thread, UI thread will lock for the system to try to display the authentication dialog.

Adding a Touch ID protected item

If you want to store the Touch ID protected Keychain item, specify accessibility and authenticationPolicy attributes.

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
    [keychain setAccessibility:UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly
          authenticationPolicy:UICKeyChainStoreAuthenticationPolicyUserPresence];

    keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef"
});

Updating a Touch ID protected item

The same way as when adding.

Do not run in the main thread if there is a possibility that the item you are trying to add already exists, and protected. Because updating protected items requires authentication.

Additionally, you want to show custom authentication prompt message when updating, specify an authenticationPrompt attribute. If the item not protected, the authenticationPrompt parameter just be ignored.

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
    [keychain setAccessibility:UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly
          authenticationPolicy:UICKeyChainStoreAuthenticationPolicyUserPresence];
    keychain.authenticationPrompt = @"Authenticate to update your access token";

    keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef"
});

Obtaining a Touch ID protected item

The same way as when you get a normal item. It will be displayed automatically Touch ID or passcode authentication If the item you try to get is protected.
If you want to show custom authentication prompt message, specify an authenticationPrompt attribute. If the item not protected, the authenticationPrompt parameter just be ignored.

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
    [keychain setAccessibility:UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly
          authenticationPolicy:UICKeyChainStoreAuthenticationPolicyUserPresence];
    keychain.authenticationPrompt = @"Authenticate to update your access token";

    NSString *token = keychain[@"kishikawakatsumi"];
});

Removing a Touch ID protected item

The same way as when you remove a normal item. There is no way to show Touch ID or passcode authentication when removing Keychain items.

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"];

keychain[@"kishikawakatsumi"] = nil;

Shared Web Credentials

Shared web credentials is a programming interface that enables native iOS apps to share credentials with their website counterparts. For example, a user may log in to a website in Safari, entering a user name and password, and save those credentials using the iCloud Keychain. Later, the user may run a native app from the same developer, and instead of the app requiring the user to reenter a user name and password, shared web credentials gives it access to the credentials that were entered earlier in Safari. The user can also create new accounts, update passwords, or delete her account from within the app. These changes are then saved and used by Safari.
https://developer.apple.com/library/ios/documentation/Security/Reference/SharedWebCredentialsRef/

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://kishikawakatsumi.com"]
protocolType:UICKeyChainStoreProtocolTypeHTTPS];
NSString *username = @"[email protected]";
NSString *password = keychain[username];
if (password) {
    // If found password in the Keychain,
    // then log into the server
} else {
    // If not found password in the Keychain,
    // try to read from Shared Web Credentials
    [keychain sharedPasswordForAccount:username completion:^(NSString *password, NSError *error) {
        if (password) {
            // If found password in the Shared Web Credentials,
            // then log into the server
            // and save the password to the Keychain

            keychain[username] = password
        } else {
            // If not found password either in the Keychain also Shared Web Credentials,
            // prompt for username and password

            // Log into server

            // If the login is successful,
            // save the credentials to both the Keychain and the Shared Web Credentials.

            keychain[username] = password
            [keychain setSharedPassword:password forAccount:username completion:nil];
        }
    }];
}

Request all associated domain's credentials

[UICKeyChainStore requestSharedWebCredentialWithCompletion:^(NSArray *credentials, NSError *error) {

}];

Generate strong random password

Generate strong random password that is in the same format used by Safari autofill (xxx-xxx-xxx-xxx).

NSString *password = [UICKeyChainStore generatePassword];
NSLog(@"%@", password); // => Nhu-GKm-s3n-pMx

How to set up Shared Web Credentials

  1. Add a com.apple.developer.associated-domains entitlement to your app. This entitlement must include all the domains with which you want to share credentials.
  1. Add an apple-app-site-association file to your website. This file must include application identifiers for all the apps with which the site wants to share credentials, and it must be properly signed.
  1. When the app is installed, the system downloads and verifies the site association file for each of its associated domains. If the verification is successful, the app is associated with the domain.

More details:
https://developer.apple.com/library/ios/documentation/Security/Reference/SharedWebCredentialsRef/

Debugging

Display all stored items if print keychain object

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com"]
                                                          protocolType:UICKeyChainStoreProtocolTypeHTTPS];
NSLog(@"%@", keychain);
=>
(
{
    accessibility = ak;
    authenticationType = dflt;
    class = InternetPassword;
    key = kishikawakatsumi;
    protocol = htps;
    server = "github.com";
    synchronizable = 0;
    value = "01234567-89ab-cdef-0123-456789abcdef";
}    {
    accessibility = ck;
    authenticationType = dflt;
    class = InternetPassword;
    key = hirohamada;
    protocol = htps;
    server = "github.com";
    synchronizable = 1;
    value = "11111111-89ab-cdef-1111-456789abcdef";
}    {
    accessibility = ak;
    authenticationType = dflt;
    class = InternetPassword;
    key = honeylemon;
    protocol = htps;
    server = "github.com";
    synchronizable = 0;
    value = "22222222-89ab-cdef-2222-456789abcdef";
})

Obtaining all stored keys

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com"]
                                                          protocolType:UICKeyChainStoreProtocolTypeHTTPS];

NSArray *keys = keychain.allKeys;
for (NSString *key in keys) {
    NSLog(@"key: %@", key);
}
=>
key: kishikawakatsumi
key: hirohamada
key: honeylemon

Obtaining all stored items

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com"]
                                                          protocolType:UICKeyChainStoreProtocolTypeHTTPS];

NSArray *items = keychain.allItems;
for (NSString *item in items) {
    NSLog(@"item: %@", item);
}
=>

item: {
    accessibility = ak;
    authenticationType = dflt;
    class = InternetPassword;
    key = kishikawakatsumi;
    protocol = htps;
    server = "github.com";
    synchronizable = 0;
    value = "01234567-89ab-cdef-0123-456789abcdef";
}
item: {
    accessibility = ck;
    authenticationType = dflt;
    class = InternetPassword;
    key = hirohamada;
    protocol = htps;
    server = "github.com";
    synchronizable = 1;
    value = "11111111-89ab-cdef-1111-456789abcdef";
}
item: {
    accessibility = ak;
    authenticationType = dflt;
    class = InternetPassword;
    key = honeylemon;
    protocol = htps;
    server = "github.com";
    synchronizable = 0;
    value = "22222222-89ab-cdef-2222-456789abcdef";
}

Convenient class methods

Add items using default service name (=bundle identifer).

[UICKeyChainStore setString:@"01234567-89ab-cdef-0123-456789abcdef" forKey:@"kishikawakatsumi"];

Or specify the service name.

[UICKeyChainStore setString:@"01234567-89ab-cdef-0123-456789abcdef"
                     forKey:@"kishikawakatsumi"
                    service:@"com.example.github-token"];

Remove items.

[UICKeyChainStore removeItemForKey:@"kishikawakatsumi" service:@"com.example.github-token"];

To set nil value also works remove item for the key.

[UICKeyChainStore setString:nil forKey:@"kishikawakatsumi" service:@"com.example.github-token"];

Requirements

iOS 4.3 or later OS X 10.7 or later

Installation

Swift Package Manager

UICKeyChainStore is now available through Swift Package Manager.

Xcode

Select File > Swift Packages > Add Package Dependency...

Type https://github.com/kishikawakatsumi/UICKeyChainStore then check the target that appears.

CLI

Create Package.swift file and define the dependency like this

// swift-tools-version:5.0
import PackageDescription

let package = Package(
    name: "MyLibrary",
    products: [
        .library(name: "MyLibrary", targets: ["MyLibrary"]),
    ],
    dependencies: [
        .package(url: "https://github.com/kishikawakatsumi/UICKeyChainStore.git", from: "2.1.2"),
    ],
    targets: [
        .target(name: "MyLibrary", dependencies: ["UICKeyChainStore"]),
    ]
)

Then, type

$ swift build

CocoaPods

UICKeyChainStore is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'UICKeyChainStore'

For watchOS 2
use_frameworks!

target 'EampleApp' do
  pod 'UICKeyChainStore'
end

target 'EampleApp WatchKit Extension' do
  platform :watchos, '2.0'
  pod 'UICKeyChainStore'
end

Carthage

UICKeyChainStore is available through Carthage. To install it, simply add the following line to your Cartfile:

github "kishikawakatsumi/UICKeyChainStore"

To manually add to your project

  1. Add Security.framework to your target.
  2. Copy files in Lib (UICKeyChainStore.h and UICKeyChainStore.m) to your project.

Author

kishikawa katsumi, [email protected]

License

UICKeyChainStore is available under the MIT license. See the LICENSE file for more info.

Comments
  • keychain returns nil

    keychain returns nil

    Hi, I got this weird problem, When i wanna retrieve from keychain it works fine, but just after that when i wanna do it again in another class i get nil.

    this is how i call it:
    keyChain = [UICKeyChainStore keyChainStoreWithService:@"myapp.Login"];

    opened by rashidasgari 16
  • anyone can help me

    anyone can help me

            UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"xh.english.brush"
                                                                        accessGroup:@"test.hello"];
    
            keychain[@"user_name"]    = loginView.userNameField.text;
            keychain[@"pass_word"]    = @"123456";
            keychain[@"downDataFlag"] = [returnValue.D ObjectForKey:@"downDataFlag"];
            keychain[@"usFlag"]       = [returnValue.D ObjectForKey:@"usFlag"];
            keychain[@"usGroupid"]    = [returnValue.D ObjectForKey:@"usGroupid"];
            keychain[@"usId"]         = [returnValue.D ObjectForKey:@"usId"];
            keychain[@"usName"]       = [returnValue.D ObjectForKey:@"usName"];
            keychain[@"usSessionId"]  = [returnValue.D ObjectForKey:@"usSessionId"];
            keychain[@"usType"]       = [returnValue.D ObjectForKey:@"usType"];
            keychain[@"usUid"]        = [returnValue.D ObjectForKey:@"usUid"];
    
            NSLog(@"keychainpass_word=%@",keychain[@"pass_word"]);
    

    keychainpass_word is nil

    opened by codesourse 13
  • UICKeyChainStore doesn't work in iOS 8

    UICKeyChainStore doesn't work in iOS 8

    Just tried with Xcode 6.0 and the iOS 8 preview SDK and SecItemCopyMatching() in setData:forKey:service:accessGroup returns -34018

    Can you please have a look?

    Thanks!

    opened by siancu 8
  • OSStatus error: [-25243] Security error has occurred.

    OSStatus error: [-25243] Security error has occurred.

    I am trying to write to the keychain in iOS with accessGroup while testing on my device, I am getting the error OSStatus error: [-25243] Security error has occurred.

    UICKeyChainStore *store = [UICKeyChainStore keyChainStoreWithService:@"xspyhack" accessGroup:@"39V4U5AVXX.com.company.xxx"];
     store[@"Host"] = @"text"
    
    opened by xspyhack 7
  • Avoid TouchID in `-contains:`

    Avoid TouchID in `-contains:`

    This change should allow to check if an TouchID-protected item exists silently. I'm not sure that it's the best approach though, it could also be exposed as a separate method.

    opened by nikolaykasyanov 6
  • 2.0.0 no longer compatible with ios < 7

    2.0.0 no longer compatible with ios < 7

    Even though webpage and cocoapods claim compatibility with ios 4.3 and later, the use of kSecAttrSynchronizable in UIKeychainStore.m means that it's only compatible with ios 7 and later, as that constant is not available before.

    Great project though - thank you!

    opened by motocodeltd 6
  • iOS10 issues

    iOS10 issues

    Are there any reported issues with new release of XCode8, iOS10 and UICKeyChainStore?

    My code runs normally with XCode7.3.1 but on XCode8Beta it started breaking. UICKeychainStore doesn't seem to return anything.

    I used UICKeyChainStore 1.0.5 and then 2.1.0 but it didn't help.

    opened by sksyed 5
  • Method accepting NSError** should have a non-void return value

    Method accepting NSError** should have a non-void return value

    The following methods all return analysis warnings 'Method accepting NSError** should have a non-void return value to indicate whether an error occurred'

    - (void)setString:(NSString *)string forKey:(NSString *)key error:(NSError *__autoreleasing *)error;
    - (void)setData:(NSData *)data forKey:(NSString *)key error:(NSError *__autoreleasing *)error;
    - (void)removeItemForKey:(NSString *)key error:(NSError *__autoreleasing *)error;
    - (void)removeAllItemsWithError:(NSError *__autoreleasing *)error;
    - (void)synchronizeWithError:(NSError *__autoreleasing *)error;
    
    opened by Simulacrotron 5
  • Return mutable versions instead of immutable versions.

    Return mutable versions instead of immutable versions.

    Changing return types from immutable to mutable versions. This gives consumers control/ownership over the data buffers used.

    I was pulling data out of the keychain and not scrubbing it when finished and that creates an attack vulnerability from a security perspective (an audit flagged this). When the NSData was dealloc'd the underlying memory still contained the data. In order for my concern to be met I needed UIKCS to return me mutable versions so I could do what I needed to do.

    opened by tmeisenh 5
  • iOS10 UICKeyChainStore is null

    iOS10 UICKeyChainStore is null

    Hello, just spent a whole day trying to debug why keychain was null on my app on iOS10, and realised it has a simple 2 minute fix: change the library to the new version (I got the one from Example-iOS project). I hope this saves someones time in the future.

    opened by nurmerey 4
  • 2.0.4 compatibility issue with iOS7

    2.0.4 compatibility issue with iOS7

    I'm starting out with AWS and following their getting started guide. The 'AWSCore' pod pulls in UICKeyChainStore pod with a 2.0.0 dependency, but I'm seeing some compile time issues in the .h and .m, for example:

    __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_4_0);

    typedef NS_ENUM(NSInteger, UICKeyChainStoreAuthenticationPolicy) { UICKeyChainStoreAuthenticationPolicyUserPresence = kSecAccessControlUserPresence, }; gives a 'use of undeclared identifier kSecAccessControlUserPresence'

    I'm also seeing many lines with:

    __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);

    and from what I can tell the error is something to do with 8_0 because changing that to 7_0 seems to 'hide' the problem.

    I'm using XCode 5.1.1 (base SDK 7.1) and OSX 10.8.5

    opened by WhiteHexagon 4
  • Fix SPM warning for Xcode 12 and 13

    Fix SPM warning for Xcode 12 and 13

    Unlike CocoaPods, SPM platforms only specify minimum supported deployment targets, and it's recommended to only specify platforms, if minimum supported deployment target is higher than Xcode's, which is not the case here.

    When using package on Xcode 13, SPM shows a warning:

    .../UICKeyChainStore/Package.swift The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99.

    By removing platforms from Package.swift this warning will go away, since now Xcode is in charge of what platforms are supported, and automatically sets minimum deployment target for this package (which, on Xcode 13, is iOS 9).

    This does not drop support for iOS 8, as support for iOS 8 was already dropped by Xcode 12, this change only removes a warning.

    This PR is an alternative to #188, so you can have a choice in two different approaches. This one seems better to me, as you no longer need to manage deployment versions, and Xcode can just select whatever is supported at the moment.

    opened by DenTelezhkin 0
  • Configure Renovate

    Configure Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    :vertical_traffic_light: To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • Lib/Gemfile (bundler)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Separate major versions of dependencies into individual branches/PRs
    • Do not separate patch and minor upgrades into separate PRs for the same dependency
    • Upgrade to unstable versions only if the existing version is unstable
    • Raise PRs immediately (after branch is created)
    • If semantic commits detected, use semantic commit type fix for dependencies and chore for all others
    • Keep existing branches updated even when not scheduled
    • Disable automerging feature - wait for humans to merge all PRs
    • Ignore node_modules, bower_components, vendor and various test/tests directories
    • Autodetect whether to pin dependencies or maintain ranges
    • Rate limit PR creation to a maximum of two per hour
    • Limit to maximum 20 open PRs at any time
    • Group known monorepo packages together
    • Use curated list of recommended non-monorepo package groupings

    :abcd: Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.


    :question: Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Error 25308 on iOS 11

    Error 25308 on iOS 11

    I used to do all the developing for iOS 10 but now was forced to migrate to iOS 11. Immediately I encountered some erratic behavior. The app uses links like app://action/[id]/ and the id corresponds to TouchID protected keychain item. When the app is run for the first time with such link, it works like a charm, but, if it is not, the app works spontaneously - most often I just get different security errors (25308, 25293) without any usable description. Everything worked perfectly on iOS 10. I thought that it could be an issue with obsolete library, but even after the update nothing changed. It gets even more interesting since the app works as expected on 11.2.1, but does not on 11.1. Moreover, if I quickly switch to another app, the TouchID prompt may appear for that app (TouchID for "Safari" but with my description), but the result will be seen in my app should I switch to it. That is so frustrating. Any help will be much appreciated!

    opened by sagarre 0
Releases(v2.2.1)
  • v2.2.1(Sep 18, 2020)

  • v2.2.0(Apr 29, 2020)

  • v2.1.2(Oct 8, 2018)

  • v2.1.1(Mar 13, 2017)

  • v2.1.0(Oct 25, 2015)

  • v2.0.7(Oct 17, 2015)

  • v2.0.6(Oct 17, 2015)

  • v2.0.5(Oct 17, 2015)

  • v2.0.4(Oct 17, 2015)

  • v2.0.3(Oct 17, 2015)

  • v2.0.2(Jan 31, 2015)

    • Add support for Shared Web Credentials https://github.com/kishikawakatsumi/UICKeyChainStore/pull/63
      • Add -[UICKeyChainStore sharedPasswordWithCompletion:]
      • Add -[UICKeyChainStore sharedPasswordForAccount:completion:]
      • Add -[UICKeyChainStore setSharedPassword:forAccount:completion:]
      • Add -[UICKeyChainStore removeSharedPasswordForAccount:completion:]
      • Add +[UICKeyChainStore requestSharedWebCredentialWithCompletion:]
      • Add +[UICKeyChainStore requestSharedWebCredentialForDomain:account:completion:
      • Add +[UICKeyChainStore generatePassword]

    Shared web credentials is a programming interface that enables native iOS apps to share credentials with their website counterparts. For example, a user may log in to a website in Safari, entering a user name and password, and save those credentials using the iCloud Keychain. Later, the user may run a native app from the same developer, and instead of the app requiring the user to reenter a user name and password, shared web credentials gives it access to the credentials that were entered earlier in Safari. The user can also create new accounts, update passwords, or delete her account from within the app. These changes are then saved and used by Safari. https://developer.apple.com/library/ios/documentation/Security/Reference/SharedWebCredentialsRef/

    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Jan 31, 2015)

    • Fix static analyzer warning for "Argument for subscript setter is an uninitialized value" https://github.com/kishikawakatsumi/UICKeyChainStore/pull/61
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Jan 17, 2015)

    • Add support for internet password https://github.com/kishikawakatsumi/UICKeyChainStore/pull/42
      • Add +[UICKeyChainStore keyChainStoreWithServer:protocolType:]
      • Add +[UICKeyChainStore keyChainStoreWithServer:protocolType:authenticationType:]
      • Add -[UICKeyChainStore initWithServer:protocolType:]
      • Add -[UICKeyChainStore initWithServer:protocolType:authenticationType:]
      • Add enum UICKeyChainStoreItemClass
      • Add enum UICKeyChainStoreProtocolType
      • Add enum UICKeyChainStoreAuthenticationType
      • Add @property (nonatomic, readonly) UICKeyChainStoreItemClass itemClass
      • Add @property (nonatomic, readonly) NSURL *server
      • Add @property (nonatomic, readonly) UICKeyChainStoreProtocolType protocolType
      • Add @property (nonatomic, readonly) UICKeyChainStoreAuthenticationType authenticationType
    • Add support for accessibility https://github.com/kishikawakatsumi/UICKeyChainStore/pull/42
      • Add enum UICKeyChainStoreAccessibility
      • Add @property (nonatomic) UICKeyChainStoreAccessibility accessibility
    • Add support for iCloud sharing https://github.com/kishikawakatsumi/UICKeyChainStore/pull/42
      • Add @property (nonatomic) BOOL synchronizable
    • Add support for TouchID and Keychain integration (iOS 8+) https://github.com/kishikawakatsumi/UICKeyChainStore/pull/42
      • Add enum UICKeyChainStoreAuthenticationPolicy
      • Add -[UICKeyChainStore setAccessibility:authenticationPolicy:]
      • Add @property (nonatomic, readonly) UICKeyChainStoreAuthenticationPolicy
      • Add @property (nonatomic) NSString *authenticationPrompt
    • Add support for label and comment https://github.com/kishikawakatsumi/UICKeyChainStore/pull/42
      • Add -[UICKeyChainStore setString:forKey:label:comment:]
      • Add -[UICKeyChainStore setString:forKey:label:comment:error:]
      • Add -[UICKeyChainStore setData:forKey:label:comment:]
      • Add -[UICKeyChainStore setData:forKey:label:comment:error:]
    • Deprecated synchronize method. Calling this method is no longer required (just ignored). https://github.com/kishikawakatsumi/UICKeyChainStore/pull/42
      • Previously, the value is actually stored had been delayed until the call synchronize method. From now storing the change immediately. There is almost no effect on the existing code by this change.
    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Jan 31, 2015)

    • Fix static analyzer warning for "Method accepting NSError** should have a non-void return value to indicate whether or not an error occurred" https://github.com/kishikawakatsumi/UICKeyChainStore/pull/33
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Jan 31, 2015)

    • Add error parameter to handle failing Keychain API https://github.com/kishikawakatsumi/UICKeyChainStore/pull/24
      • Add UICKeyChainStoreErrorDomain
      • Add enum UICKeyChainStoreErrorCode
      • Add +[UICKeyChainStore stringForKey:error:]
      • Add +[UICKeyChainStore stringForKey:service:error:]
      • Add +[UICKeyChainStore stringForKey:service:accessGroup:error:]
      • Add +[UICKeyChainStore setString:forKey:error:]
      • Add +[UICKeyChainStore setString:forKey:service:error:]
      • Add +[UICKeyChainStore setString:forKey:service:accessGroup:error:]
      • Add +[UICKeyChainStore dataForKey:error:]
      • Add +[UICKeyChainStore dataForKey:service:error:]
      • Add +[UICKeyChainStore dataForKey:service:accessGroup:error:]
      • Add +[UICKeyChainStore setData:forKey:error:]
      • Add +[UICKeyChainStore setData:forKey:service:error:]
      • Add +[UICKeyChainStore setData:forKey:service:accessGroup:error:]
      • Add -[UICKeyChainStore stringForKey:error:]
      • Add -[UICKeyChainStore setString:forKey:error:]
      • Add -[UICKeyChainStore dataForKey:error:]
      • Add -[UICKeyChainStore setData:forKey:error:]
      • Add +[UICKeyChainStore removeItemForKey:error:]
      • Add +[UICKeyChainStore removeItemForKey:service:error:]
      • Add +[UICKeyChainStore removeItemForKey:service:accessGroup:error:]
      • Add +[UICKeyChainStore removeAllItemForKey:error:]
      • Add +[UICKeyChainStore removeAllItemForKey:service:error:]
      • Add +[UICKeyChainStore removeAllItemForKey:service:accessGroup:error:]
      • Add -[UICKeyChainStore removeItemForKey:error:]
      • Add -[UICKeyChainStore removeAllItemWithError:]
      • Add -[UICKeyChainStore synchronizeWithError:]
    Source code(tar.gz)
    Source code(zip)
Owner
Kishikawa Katsumi
iOS developer
Kishikawa Katsumi
Valet lets you securely store data in the iOS, tvOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy. We promise.

Valet Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy.

Square 3.8k Jan 4, 2023
Keychain - Keychain wrapper with swift

Keychain wrapper. Store a value as a generic password: let account = "an-arbitra

Alejandro Ramirez 0 Mar 14, 2022
A Layer-2 framework built over Keychain API which helps in using Keychain in all your Apple devices with easiness and flexibility.

Keychain Manager Keychain Manager is a Layer-2 framework built over Keychain API which helps in using Keychain in all your Apple devices with easiness

Gokul Nair 14 Jan 1, 2023
A keychain wrapper that is so easy to use that your cat could use it.

A keychain wrapper that is so easy to use that your cat could use it.

HyperRedink 71 Oct 15, 2022
Simple Objective-C wrapper for the keychain that works on Mac and iOS

SAMKeychain SAMKeychain is a simple wrapper for accessing accounts, getting passwords, setting passwords, and deleting passwords using the system Keyc

Sam Soffes 5.4k Jan 8, 2023
A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift.

SwiftKeychainWrapper A simple wrapper for the iOS / tvOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift. Prov

Jason 1.5k Jan 8, 2023
Modern Swift wrapper for Keychain Services API with the benefits of static typing

SwiftyKeychainKit SwiftyKeychainKit is a simple Swift wrapper for Keychain Services API with the benefits of static typing. Define your keys in one pl

Andriy Slyusar 18 Jan 1, 2023
Example of using TOTP with iCloud Keychain in iOS 15

Installation This example needs Ngrok and Ruby 3.0.3+. Setup project with Makefi

Makeeyaf 0 Dec 31, 2021
A tool to check which keychain items are available to an attacker once an iOS device has been jailbroken

Keychain Dumper Usage All that should be needed to use keychain_dumper is the binary that is checked in to the Keychain-Dumper Git repository. This bi

Patrick Toomey 1.2k Dec 28, 2022
A powerful, protocol-oriented library for working with the keychain in Swift.

Locksmith A powerful, protocol-oriented library for working with the keychain in Swift. ?? iOS 8.0+ ?? Mac OS X 10.10+ ⌚️ watchOS 2 ?? tvOS ?? I make

Matthew Palmer 2.9k Dec 21, 2022
Recover lost keychain passwords with swift

brutalkeychain Recover lost keychain passwords using a simple swift script (so c

Charles Edge 9 Sep 12, 2022
Recover lost keychain passwords with swift

brutalkeychain Recover lost keychain passwords using a simple swift script (so c

Charles Edge 4 Dec 24, 2021
Accessibility Abstraction Layer (axabl) for macOS window management

axabl accessibility abstraction layer axabl is an abstraction layer over the accessibility API (and more) provided by Apple to make window management

null 2 Jul 31, 2022
Keep track of accessibility settings, leverage high contrast colors, and use scalable fonts to enable users with disabilities to use your app.

Accessibility for iOS, macOS, tvOS, and watchOS ?? What's new in Capable 2.0 ?? Here are the most important changes: ?? New framework architecture and

Christoph Wendt 230 Jan 4, 2023
Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.

KeychainAccess KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much mor

Kishikawa Katsumi 7.2k Dec 30, 2022
Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.

KeychainAccess KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much mor

Kishikawa Katsumi 7.2k Jan 5, 2023
Valet lets you securely store data in the iOS, tvOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy. We promise.

Valet Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy.

Square 3.8k Jan 4, 2023
A wrapper to make it really easy to deal with iOS, macOS, watchOS and Linux Keychain and store your user's credentials securely.

A wrapper (written only in Swift) to make it really easy to deal with iOS, macOS, watchOS and Linux Keychain and store your user's credentials securely.

Ezequiel Aceto 2 Mar 29, 2022
Valet lets you securely store data in the iOS, tvOS, or macOS Keychain without knowing a thing about how the Keychain works.

Valet Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy.

Square 3.8k Jan 4, 2023
A simple Swift Keychain Wrapper for iOS, watchOS, and OS X.

Latch A simple Swift 2.0 Keychain Wrapper for iOS, watchOS 2, and OS X. Usage A proper example of how to use Latch can be seen in the tests. import La

Danielle 56 Oct 25, 2022