1

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);
    }
}
Community
  • 1
  • 1
karim
  • 15,408
  • 7
  • 58
  • 96

2 Answers2

1

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.

karim
  • 15,408
  • 7
  • 58
  • 96
0

Apple provides a list of the trusted root certificate on their web site.

Black Frog
  • 11,595
  • 1
  • 35
  • 66
  • Those lists are quite old. And I need to read from the phone/pad in their existing keychain. – karim Apr 12 '13 at 13:41