Я пытаюсь использовать класс KeychainWrapper, указанный в этом примере кода Apple: https://developer.apple.com/library/content/samplecode/GenericKeychain/
В примере приложения класс имеет этот метод init, который начинается с:
- (id)initWithIdentifier: (NSString *)identifier accessGroup:(NSString *) accessGroup;
{
if (self = [super init])
{
// Begin Keychain search setup. The genericPasswordQuery leverages the special user
// defined attribute kSecAttrGeneric to distinguish itself between other generic Keychain
// items which may be included by the same application.
genericPasswordQuery = [[NSMutableDictionary alloc] init];
[genericPasswordQuery setObject:(id)kSecClassGenericPassword forKey:(id)kSecClass];
[genericPasswordQuery setObject:identifier forKey:(id)kSecAttrGeneric];
В примере приложения он использует два значения для строки идентификатора. "Пароль" и "Номер счета". При реализации класса в моем коде я использовал некоторые пользовательские идентификаторы, и код не работал. Не удалось выполнить вызов SecItemAdd(). После некоторого тестирования кажется, что использование значений, отличных от "Пароль" и "Номер счета" для идентификатора, не работает.
Кто-нибудь знает, какие значения допустимы и/или возможно ли иметь пользовательские идентификаторы для ваших объектов связки ключей?