So SecKeychainCopyDomainSearchList takes a SecPreferencesDomain, which is an enumeration of user, system, common and dynamic.
If I start with user, I get one entry back:
<SecKeychain 0x101604b70 [0x7ff84e723800]>
I only appear to be able to get the path of this SecKeychain with SecKeychainGetPath, which gives me what looks like a path on the filesystem like this:
/Users/minfrin/Library/Keychains/login.keychain-db
How do I get the name "login" from the above, do I have to parse the filename? That doesn't make sense for keychains not backed by a file, I feel like I a missing an API call or an attribute I should be requesting for the name, the docs say nothing on this.
The system enumeration gives me one keychain, with a path as follows:
/Library/Keychains/System.keychain
The common enumeration gives me the same as the system enumeration, but I can't see any explanation as to why:
/Library/Keychains/System.keychain
The dynamic enumeration gives me nothing (not tried it with any smartcards plugged in).
How does this map onto the Keychain Access application?
Neither "iCloud" nor "System Roots" appear anywhere as keychains, are these handled as special cases? Where do their names "iCloud" and "System Roots" come from, are they returned by an API or are they hardcoded?
What is the correct way to query iCloud as a keychain using SecItemCopyMatching?