34

I have developed an iPhone application in which I am encrypting and decrypting data using public and private key. I want to see this keys in the Keychain. I got the keychain entry for mac applications under Applications/utilities, but what is the location for iPhone simulator Keychain and Keychain for iPhone OS itself on device.

Philip Walton
  • 29,693
  • 16
  • 60
  • 84
Himanshu
  • 431
  • 1
  • 5
  • 6

2 Answers2

48

The iPhone simulator keychain is stored in ~/Library/Application Support/iPhone Simulator/<Version Number>/Library/Keychains/ and is in sqlite3 DB format. The location of the file on the device itself is unimportant, as you can only access it through the keychain API (but a path with a few similarities to the simulator path wouldn't surprise anyone).

  • 14
    Starting with iPhone SDK 3.2, the simulator data is stored in separate directories for each OS version inside `~/Library/Application Support/iPhone Simulator`. For instance if it's the 3.0 simulator that's running, the keychain will be stored in `~/Library/Application Support/iPhone Simulator/3.0/Library/Keychains`. – Jean Regisser Apr 16 '10 at 09:54
  • I dont have any iphone simulator folder in application support... what am i suppose to do now – Muhammad Umar Sep 30 '12 at 04:51
  • Have a look at the script charles proxy uses to install it's CA into the simulator keychain it's pretty cool. http://www.charlesproxy.com/documentation/faqs/ http://www.charlesproxy.com/assets/install-charles-ca-cert-for-iphone-simulator.zip – russau Feb 21 '13 at 18:45
  • What is the command to access this via keychain. Can I see it in the keychain application? – lostintranslation Aug 06 '14 at 21:52
  • 30
    Starting with iOS 8 SDK, you can find keychains in the `~/Library/Developer/CoreSimulator/Devices//data/Library/Keychains` – ReDetection Aug 22 '14 at 04:05
  • 1
    I can see the keychain in the path, but even after saving information in keychain, I find that the keychain-2.db debug file's timestamp is not updated. Any idea as to which file to see and confirm that data saved, in iOS simulator. – Soumya Jan 18 '17 at 20:06
-9

You must acces the keychain through the keychain API, just like explained in this example.

joobik
  • 57
  • 1