【发布时间】: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 上我没有这个问题,只是工作完美。 你能帮帮我吗?
对不起,我的英语不好。
【问题讨论】: