Get Trust object for trusted root certificates embeded in iOS

I want to get the system trust store in iOS which has trusted root certificates embedded in iOS. From other posts, I learned that we can anchor root certificates manually in SecTrust. But not finding a way to get the default trust object. Please help!

Reading through your post I’m not 100% sure as to your goals. There are two common tasks in this space:

  • Get the root certificate that anchors a specific certificate chain.

  • Enumerate the entire trust store.

The first one is fairly straightforward:

  1. Create a trust object (SecTrust) with your certificate.

  2. Evaluate it.

  3. Get the certificate chain from that.

  4. Assuming the evaluation was successful, the last entry in the chain is the trusted anchor.

With regards the second task, there’s no supported way to do that on iOS (although Apple Support does publish a list of built-in roots).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Get Trust object for trusted root certificates embeded in iOS
 
 
Q