Hi, I’m trying to save data to the iOS keychain.
I use the following piece of code to accomplish that:
val searchDictionary = CFDictionaryCreateMutable(kCFAllocatorDefault, 5, null, null)
CFDictionaryAddValue(searchDictionary, kSecClass, kSecClassGenericPassword)
CFDictionaryAddValue(searchDictionary, kSecAttrService, CFBridgingRetain(appName))
CFDictionaryAddValue(searchDictionary, kSecAttrGeneric, CFBridgingRetain(identifier))
CFDictionaryAddValue(searchDictionary, kSecAttrAccount, CFBridgingRetain(identifier))
CFDictionaryAddValue(searchDictionary, kSecValueData, CFBridgingRetain(NSNumber(int = 2048)))
SecItemAdd(searchDictionary, null)
But I keep getting OSStatus -50 (One or more parameters passed to a function were not valid.). I followed several Ojective-c tutorials to come up with this code and it should be valid.. Someone got an idea what I’m missing?