Visualizing Keychain Item Details

keychain

I'm a developer working on doing some keychain related features. A piece of my application changes / looks for items in the keychain. However, visually verifying some of these changes can be difficult because the Keychain Access.app doesn't show all of the fields. For example, the kSecProtocolItemAttr attribute for internet passwords is not displayed in the Keychain app.

Is there a better way (Command line or other) to visual items that are in a .keychain file, that show all of the properties associated with that item?

Best Answer

The CLI for keychains is: security.

It lets you do many things such as…

  • Getting item info:

    security find-generic-password -a <item-name>
    
  • Getting passwords:

    security 2>&1 >/dev/null find-generic-password -ga <item-name>
    

Read the man page for more info or do security help.