SecItemAdd and SecItemCopyMatching returns error code -34018 (errSecMissingEntitlement)

iOS 10 / XCode 8 Fix: Add KeyChain Entitlement, Go to project settings->Capabilities->Keychain Sharing->Add Keychain Groups+Turn On An answer here, from Apple: UPDATE: We have finally been able to reproduce the -34018 error on iOS 8.3. This is the first step in identifying the root cause and then coming up with a fix. As usual, … Read more

Mac OS X wants to use system keychain when compiling the project

Open Keychain Access. In the top-left corner, unlock the keychain (if it is locked). Choose the System keychain from the top-left corner. Find your distribution certificate and click the disclosure triangle. Double-click ‘Private key’ under your distribution certificate. In the popup, go to the Access Control tab. Select ‘Allow all applications to access this item’. … Read more

What makes a keychain item unique (in iOS)?

The primary keys are as follows (derived from open source files from Apple, see Schema.m4, KeySchema.m4 and SecItem.cpp): For a keychain item of class kSecClassGenericPassword, the primary key is the combination of kSecAttrAccount and kSecAttrService. For a keychain item of class kSecClassInternetPassword, the primary key is the combination of kSecAttrAccount, kSecAttrSecurityDomain, kSecAttrServer, kSecAttrProtocol, kSecAttrAuthenticationType, kSecAttrPort … Read more

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

With Xcode 4.2 and later versions, including Xcode 4.6, there is a better way to migrate your entire developer profile to a new machine. On your existing machine, launch Xcode and do this: Open the Organizer (Shift-Command-2). Select the Devices tab. Choose Developer Profile in the upper-left corner under LIBRARY, which may be under the … Read more

Delete keychain items when an app is uninstalled

You can take advantage of the fact that NSUserDefaults are cleared by uninstallation of an app. For example: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Clear keychain on first run in case of reinstallation if (![[NSUserDefaults standardUserDefaults] objectForKey:@”FirstRun”]) { // Delete values from keychain here [[NSUserDefaults standardUserDefaults] setValue:@”1strun” forKey:@”FirstRun”]; [[NSUserDefaults standardUserDefaults] synchronize]; } //…Other stuff that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)