Reputation: 15589
I want to get the list of iOS trusted root certificate in human readable form. By writing code or any tools. How can I get that?
I tried with some code like the following from here, but its return null. Status return -25300, which is item not found.
- (void) readCert2 {
NSMutableDictionary *query = [NSMutableDictionary dictionaryWithObjectsAndKeys:
// (__bridge id)kCFBooleanTrue, (__bridge id)kSecReturnAttributes,
(__bridge id)kCFBooleanTrue, (__bridge id)kSecReturnRef,
(__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;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result);
NSLog(@"%@", (__bridge id)result);
if (result != NULL) CFRelease(result);
}
}
Upvotes: 1
Views: 1427
Reputation: 15589
The answer is, its not possible yet upto the iOS 6.1.4 APIs. I have asked in apple forum and one of the apple developers answered so.
Upvotes: 1
Reputation: 11725
Apple provides a list of the trusted root certificate on their web site.
Upvotes: 0