keychainitemwrapper

KeychainItemWrapper error when specifying an access group

牧云@^-^@ 提交于 2019-12-10 22:08:15
问题 For quite some time, I have been successfully reading and writing private keychain items using the ARC version of KeychainItemWrapper. I'm now working to convert my iOS app to use a shared access group so that the keychain items can be accessed by my 2 apps that share the same app prefix. In the Capabilities section, I've added the keychain group "MYAPPPREFIX.MYSHAREDACCESSNAME" I'm using these lines to write my variable to the keychain group: keychainItemWrapper = [[KeychainItemWrapper alloc

KeychainItemWrapper Crashing for iOS8

耗尽温柔 提交于 2019-12-09 18:40:56
问题 I'm using KeychainItemWrapper for my application using the following line of code KeychainItemWrapper *currentUser = [[KeychainItemWrapper alloc] initWithIdentifier:@"com.example" accessGroup:nil]; [currentUser setObject:accountString forKey:CFBridgingRelease(kSecAttrAccount)]; accountString is a string containing my user information. The code works perfectly fine with iOS7 but crashes with iOS8. I'm not sure what i'm doing wrong., can someone please help!! I'm running the application on a

how to store nsdictionary inside keychainwrapper

倖福魔咒の 提交于 2019-12-08 05:32:10
问题 I am using apple provided keychainwrapper sample code to store NSDictionary data which i get in my application authorization. I am receiving errSecParam (-50) as error code from SecItemAdd API. Below is the code for keychainwrapper.m #import "KeychainItemWrapper.h" #import "SynthesizeSingleton.h" #import <Security/Security.h> @interface KeychainItemWrapper (PrivateMethods) /* The decision behind the following two methods (secItemFormatToDictionary and dictionaryToSecItemFormat) was to

KeychainItemWrapper crash on iOS10

吃可爱长大的小学妹 提交于 2019-12-07 04:56:21
问题 When I try to add the item to Keychain i found this crash on iOS10 *** Assertion failure in -[KeychainItemWrapper writeToKeychain] On iOS 9.3 I write the key in the keychain without problem Thanks 回答1: It looks like a bug; a bug report has been filed, but there's a workaround. Just enable "Keychain Sharing" (under your app -> Capabilities tab in Xcode). See https://forums.developer.apple.com/thread/51071 for full background. 回答2: Edit: Ignore what I was rambling about... duh, forgot that

KeychainItemWrapper crash on iOS10

点点圈 提交于 2019-12-05 10:10:45
When I try to add the item to Keychain i found this crash on iOS10 *** Assertion failure in -[KeychainItemWrapper writeToKeychain] On iOS 9.3 I write the key in the keychain without problem Thanks It looks like a bug; a bug report has been filed, but there's a workaround. Just enable "Keychain Sharing" (under your app -> Capabilities tab in Xcode). See https://forums.developer.apple.com/thread/51071 for full background. Edit: Ignore what I was rambling about... duh, forgot that under the project target's Capabilities tab I have also enabled Keychain sharing... Though still would like to get a

KeychainItemWrapper Crashing for iOS8

蹲街弑〆低调 提交于 2019-12-04 09:14:00
I'm using KeychainItemWrapper for my application using the following line of code KeychainItemWrapper *currentUser = [[KeychainItemWrapper alloc] initWithIdentifier:@"com.example" accessGroup:nil]; [currentUser setObject:accountString forKey:CFBridgingRelease(kSecAttrAccount)]; accountString is a string containing my user information. The code works perfectly fine with iOS7 but crashes with iOS8. I'm not sure what i'm doing wrong., can someone please help!! I'm running the application on a simulator. update: Here is the crash * Assertion failure in -[KeychainItemWrapper writeToKeychain] *

Trying to use KeychainItemWrapper by Apple “translated” to Swift

本小妞迷上赌 提交于 2019-12-03 06:46:43
Sigh, I have been working on this the whole afternoon... here is my nightmare: I am trying to use the KeychainItemWrapper made by Apple. But I "translated" its Objective-C codes to Swift: import Foundation import Security class MyKeychainItemWrapper: NSObject { var keychainItemData: NSMutableDictionary? var genericPasswordQuery: NSMutableDictionary = NSMutableDictionary() init(identifier: String, accessGroup: String?) { super.init() // Begin Keychain search setup. The genericPasswordQuery leverages the special user // defined attribute kSecAttrGeneric to distinguish itself between other

Saving in KeyChainItemWrapper crashes for password

与世无争的帅哥 提交于 2019-12-02 20:50:11
Apple has provided KeyChainItemWrapper class in their GenericKeyChain sample code . There is an ARC'ed solution here on SO, which I am trying to follow: wrapper to store in the KeyChain on iOS. The usage of the wrapper is like this: KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"F11-email-auth" accessGroup:nil]; [keychain setObject:[emailTextfield text] forKey:(__bridge id)(kSecMatchEmailAddressIfPresent)]; [keychain setObject:[passwordTextfield text] forKey:(__bridge id)(kSecClassGenericPassword)]; the line with email text field is accepted. But the second

iOS Keychain writing value results in error code -34018

馋奶兔 提交于 2019-11-27 11:36:53
问题 I have an iOS application that stores some sensitive information in the keychain. While writing values into the keychain, I am getting error code -34018. I am currently using Apple's iOS KeyChainItemWrapper class. Both of the following lines of code receive the same error code. OSStatus res1 = SecItemCopyMatching((__bridge CFDictionaryRef)genericPasswordQuery, (CFTypeRef *)&attributes); OSStatus res = SecItemUpdate((__bridge CFDictionaryRef)updateItem, (__bridge CFDictionaryRef)tempCheck);