Search code examples
osx-maverickskeychain

Where does MacOS store the *list* of active keychains?


My login.keychain does not appear in the keychain search list. I am convinced this is a permissions problem, left over from a recent migration from an older machine, which caused havoc for a time.

I can add the keychain in Keychain Access (KA) and can use it, even adding and deleting items. However, when I quit and re-start KA, it's missing again. I tried using Terminal to add it using "security", but this had the same result. The list simply won't change.

The chain itself seems fine, and I used the Recreate and Keychain First Aid to no avail - I think because they're attacking different issues.

So, does anyone know where this information is stored, and what files I might need to fix/delete to get everything working again?


Solution

  • Keychain search lists are stored in /Library/Preferences/com.apple.security.plist for the system, and ~/Library/Preferences/com.apple.security.plist for each user.

    The plist contents look like this:

    <dict>
        <key>DLDBSearchList</key>
        <array>
            <dict>
                <key>DbName</key>
                <string>... path to keychain file ...</string>
                <key>GUID</key>
                <string>{...}</string>
                <key>SubserviceType</key>
                <integer>6</integer>
            </dict>
    
            ... more dict entries ...
    
        </array>
        <key>DefaultKeychain</key>
        <array>
            <dict>
                <key>DbName</key>
                <string>... path to keychain file ...</string>
                <key>GUID</key>
                <string>{...}</string>
                <key>SubserviceType</key>
                <integer>6</integer>
            </dict>
        </array>
    </dict>