How can I delete a certificate that got restored from a backup under iOS 10/11?

Solution 1:

I found a certificate in my iOS device's Certificate Trust Settings. And it was not be found in Profiles. Finally I remove it by add the cert file again, and then I can found and remove it in Profiles.

At first, I can't found the cert file, because this CA was installed years ago. So I did these things:

  1. Backup iPhone to Mac, View backup file by some software (I used iMazing)
  2. Find TrustStore.sqlite3 in Backup/KeychainDomain/ and export it to HOME DIR.
  3. Use this project https://github.com/ADVTOOLS/ADVTrustStore to export certfile

    ./iosCertTrustManager.py -t ~/TrustStore.sqlite3 -e ~/foo.crt
    
  4. Airdrop or Email this crt file to iOS device, and install it.

  5. Find it in Settings > General > Profiles and Remove it.

  6. It disappear in "Certificate Trust Settings"

Done.