I want to get the list of certificates installed on iPhone or iPad. So I can use that to pick one and use for ssl verification at server. However I m not able to get this list. I have seen in this following link that it is not possible in iOS to get certificates as one can access only their own keychain. iOS get Configuration Profiles that are installed
However I doubt :).
From the below link Get Certificates in Keychain I m using the code to get certificates. However I m getting nil data.
NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:
(__bridge id)(kSecClassCertificate), kSecClass,
[NSNull null], kSecMatchSearchList,
kCFBooleanTrue, kSecReturnRef,
kSecMatchLimitAll, kSecMatchLimit,
nil];
CFDataRef *items = nil;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, ((CFTypeRef *)&items));
I m giving [NSNull null] for search list with assumption that if keychain ref is NULL then device takes the default keychain.
My questions are 1) Is it possible to get list of installed certificates from iPhone. 2) If so how? What is wrong in the above code?