Hello everyone,
I am trying to save an identity into a group keychain. I am doing it this way, following the documentation:
I am getting error (or resultCode) -50, which means password has not been save successfully.
As a no-team programmer, my accessGroup it's just the group Bundle identifier, registered in Signing & Capabilities -> Keychain Sharing. I don't know if maybe the reason of this code is because the group is not alright or something else it's happening, although it looks I am using the identity the right way.
I am trying to save an identity into a group keychain. I am doing it this way, following the documentation:
Code Block let queryAdd: [String: AnyObject] = [ kSecClass as String: kSecClassGenericPassword, kSecAttrAccount as String: kSecImportItemIdentity as AnyObject, kSecValueData as String: identity as SecIdentity, kSecAttrAccessible as String: kSecAttrAccessibleWhenUnlocked, kSecAttrAccessGroup as String: accessGroup as AnyObject ] let resultCode = SecItemAdd(queryAdd as CFDictionary, nil) if resultCode != noErr { print("Error saving to Keychain: \(resultCode)") }
I am getting error (or resultCode) -50, which means password has not been save successfully.
As a no-team programmer, my accessGroup it's just the group Bundle identifier, registered in Signing & Capabilities -> Keychain Sharing. I don't know if maybe the reason of this code is because the group is not alright or something else it's happening, although it looks I am using the identity the right way.