【问题标题】:iPhone4 SecItemCopyMatching returns -25300 after rebootiPhone4 SecItemCopyMatching 重启后返回-25300
【发布时间】:2012-07-18 09:21:59
【问题描述】:

我的方法:

+(SecKeyRef)getKeyByTagWithoutAlert:(NSString *)keyTag status:(OSStatus *) status{
    *status = noErr;
    SecKeyRef key = NULL;

    NSMutableDictionary *queryKey = [[NSMutableDictionary alloc] init];

    // Set the key query dictionary.
    [queryKey setObject:(id)kSecClassKey forKey:(id)kSecClass];
    [queryKey setObject:[SecKeyUtility getDataByTag:keyTag] forKey:(id)kSecAttrApplicationTag];
    [queryKey setObject:(id)kSecAttrKeyTypeRSA forKey:(id)kSecAttrKeyType];
    [queryKey setObject:[NSNumber numberWithBool:YES] forKey:(id)kSecReturnRef];

    *status = SecItemCopyMatching((CFDictionaryRef)queryKey, (CFTypeRef *)&key);

    [queryKey release];
    return key;
}

在我重新启动 iPhone4 之前它工作正常。在此 SecItemCopyMatching 返回错误代码 -25300 之后,我的应用程序停止正常工作。在 iPhone3 上我没有这个问题,只是工作完美。 你能帮帮我吗?

对不起,我的英语不好。

【问题讨论】:

    标签: iphone security ios5


    【解决方案1】:

    错误25300errSecItemNotFound,这意味着你的钥匙链中没有这个项目。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-17
      • 2023-03-29
      • 1970-01-01
      • 2013-12-19
      • 1970-01-01
      • 1970-01-01
      • 2018-10-20
      相关资源
      最近更新 更多