유효한 사전이 아니고 빈 사전을 제공하고 있습니다.
당신이 code from the answer you were looking at을 가지고 프로젝트에 드롭하는 경우 :
NSMutableDictionary *query = [NSMutableDictionary dictionaryWithObjectsAndKeys:
(__bridge id)kCFBooleanTrue, (__bridge id)kSecReturnAttributes,
(__bridge id)kSecMatchLimitAll, (__bridge id)kSecMatchLimit,
nil];
NSArray *secItemClasses = [NSArray arrayWithObjects:
(__bridge id)kSecClassGenericPassword,
(__bridge id)kSecClassInternetPassword,
(__bridge id)kSecClassCertificate,
(__bridge id)kSecClassKey,
(__bridge id)kSecClassIdentity,
nil];
for (id secItemClass in secItemClasses) {
[query setObject:secItemClass forKey:(__bridge id)kSecClass];
CFTypeRef result = NULL;
SecItemCopyMatching((__bridge CFDictionaryRef)query, &result);
NSLog(@"%@", (__bridge id)result);
if (result != NULL) CFRelease(result);
}
당신은 행복한 결과를해야합니다.
동등한 CoreFoundation에서 당신이 (당신이 작성하는 있으리라 믿고있어 무엇 인) 맥 OS 명령 행 도구에서 코코아 프레임 워크를 포함 할 수 없습니다 이유가 없다을 추가 할
편집했다. 커맨드 라인 도구가 쉽게 포함 할 수없는 것은 AppKit UI 프레임 워크입니다.
은 어쨌든, 여기에 CoreFoundation에서의 동일합니다 : 나는, 나는 다양한 키 체인 항목 및 인증서의 매우 큰 덤프를보고 있어요 내 자신의 테스트 응용 프로그램에이를 넣어
CFMutableDictionaryRef query = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(query, kSecReturnAttributes, kCFBooleanTrue);
CFDictionarySetValue(query, kSecMatchLimit, kSecMatchLimitAll);
CFTypeRef types[5];
types[0] = kSecClassGenericPassword;
types[1] = kSecClassInternetPassword;
types[2] = kSecClassCertificate;
types[3] = kSecClassKey;
types[4] = kSecClassIdentity;
CFArrayRef secItemClasses = CFArrayCreate(NULL, (void *)types, 5, &kCFTypeArrayCallBacks);
CFIndex i, c = CFArrayGetCount(secItemClasses);
for(i = 0; i<c; i++)
{
CFTypeRef secItemClass = CFArrayGetValueAtIndex(secItemClasses,i);
CFDictionarySetValue(query, kSecClass, secItemClass);
CFTypeRef result = NULL;
SecItemCopyMatching(query, &result);
NSLog(@"%@", (__bridge id)result);
if (result != NULL) CFRelease(result);
}
CFRelease(secItemClasses);
CFRelease(query);
.
답변 해 주셔서 감사합니다. 그러나 Cocoa.framework없이 응용 프로그램을 작성하려면이 코드를 CoreFoundation.framework로 적응시켜야합니다. 그것에 따르면, 나는 어떻게 대답 할 수 있습니까? 그런 다음 사이트에서 내 비밀번호와 로그인을 찾는 방법은 무엇입니까? – neo
고맙습니다 !!!)))))))))))))) – neo