keychain

+entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name 'Account''

泄露秘密 提交于 2019-12-28 03:05:10
问题 I have tried a lot of options, but can't find the solution for this problem. I created a Core Data file and named the entity Account, Created an string attribute called username. Then edited the class of the entity to NSManagedObject, not sure if this is right. Now, the following code is in my LoginViewController: - (void)viewDidLoad { [super viewDidLoad]; ITAppDelegate *appDelegate = (ITAppDelegate *)[[UIApplication sharedApplication] delegate]; NSManagedObjectContext *context = appDelegate

Adding a self-signed certificate to iphone Simulator?

回眸只為那壹抹淺笑 提交于 2019-12-28 01:43:06
问题 I have a self-signed certificate at the endpoint of my API. I'm trying to test some things using the simulator but am getting "untrusted server certificate". I have tried to use safari on the simulator to download the .crt file, but that doesn't seem to work. Where does iPhone Simulator get its keychain from? How can I add a trusted certificate so my application will work? UPDATE I got it to work by creating a CA and then adding a CA certificate using the iPhone provisioning tool. Then I was

Delete keychain items when an app is uninstalled

*爱你&永不变心* 提交于 2019-12-27 10:44:10
问题 I am using idandersen's scifihifi-iphone code for keychain and save password using [SFHFKeychainUtils storeUsername:@"User" andPassword:@"123" forServiceName:@"TestService" updateExisting:YES error:&error]; When I delete the application from the device, the password remains in the keychain. I want to remove the password from the keychain when the user deletes the application from the device. How can I do this? 回答1: You can take advantage of the fact that NSUserDefaults are cleared by

Delete keychain items when an app is uninstalled

假装没事ソ 提交于 2019-12-27 10:42:07
问题 I am using idandersen's scifihifi-iphone code for keychain and save password using [SFHFKeychainUtils storeUsername:@"User" andPassword:@"123" forServiceName:@"TestService" updateExisting:YES error:&error]; When I delete the application from the device, the password remains in the keychain. I want to remove the password from the keychain when the user deletes the application from the device. How can I do this? 回答1: You can take advantage of the fact that NSUserDefaults are cleared by

Xcode 4 - “Valid signing identity not found” error on provisioning profiles on a new Macintosh install

邮差的信 提交于 2019-12-27 10:35:45
问题 I had a Macintosh I used to develop iPhone apps with using XCode 4. I now have a new Macintosh with a new install of... everything. When opening Xcode projects built on the old Mac, I cannot run the app on the iPhone that was configured as a development iPhone. Xcode 4 organizer tells me "Valid signing identity not found" on my provisioning profiles. I guess this is something to do with the .certSigningRequest file I had generated before on the old Mac (I have a backup of that file), but what

Storing iOS app's user password and username

妖精的绣舞 提交于 2019-12-25 07:52:44
问题 I am using a SQLite database to build an iOS app. Which is the best way to store username and password: in the database or the Keychain? Also, if I store any data in database how can I make it secure like the keychain? 回答1: Keychain is better. However, we recommend that you don't save the password. You should always save the hash value and compare the hashes to see if the login is correct! 回答2: Keychain is the best option to save any kind of passwords. Use library SSKeychain which is a light

IOS store more than one password in keychain

独自空忆成欢 提交于 2019-12-25 02:59:39
问题 in my app I can save an read fine 1 password store in the keychain using this code // save password [keychainItem setObject:textFieldPassword.text forKey:(__bridge id)(kSecValueData)]; //get pasword from keychain NSString *_password = [keychainItem objectForKey:(__bridge id)(kSecValueData)]; My question is: how can I store more than 1 password at a time in the keychain? 回答1: Keychain programming is hard. I use a wrapper class called SFHFKeychainUtils. It has very simple class methods for

OSX security find-identity can't find identities in ssh-ed machine

房东的猫 提交于 2019-12-24 15:16:06
问题 I am ssh-ing into otherosx OSX (10.10.3) machine from my OSX(10.10.3) machine in order to build a mac application. ssh user@otherosx Then on otherosx I try to import identities like this: security default-keychain -s /path/to/my/login.keychain security unlock-keychain security import my_identity.p12 -P passphrase Then I try to find my identity: security find-identity and I get this: Policy: X.509 Basic Matching identities 0 identities found Valid identities only 0 valid identities found Does

Getting error using CFTypeRef with ARC

自古美人都是妖i 提交于 2019-12-24 14:15:14
问题 I basically followed this tutorial, and soon realized the project wouldn't compile because I was using ARC. I managed to suppress all the errors using __bridge (>.>) but I am still getting one error message, and I managed to read this stack question, but didn't understand how to apply the resolution to my problem. Basically the method that is giving me the problem looks like this: + (NSString*)getPasswordForKey:(NSString*)aKey { NSString *password = nil; NSMutableDictionary *searchDictionary

Unable to store values in keychain correctly

那年仲夏 提交于 2019-12-24 04:24:47
问题 I am using the following to store values in the keychain: KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"suggest" accessGroup:nil]; [keychain setObject:[object valueForKey:@"token"] forKey:(__bridge id)(kSecValueData)]; [keychain setObject:[object valueForKey:@"usr_id"] forKey:(__bridge id)(kSecAttrAccount)]; Here is my code for retrieving values: KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"suggest" accessGroup:nil];