Keychain Viewer

This document is based upon the work done by Michael Stoner, and documented in an "Ask Different" post about how to "Export keychains" in MacOS. I've expanded it to run on virtually any recent MacOSX, from Leopard (10.5) on up to Yosemite (10.10). I've tested it on them, and Snow Leopard.

The Keychain.View disk-image contains three different programs, which together make it possible for you to extract "Internet password" entries from the Keychain Access utility. Download the disk-image (below) and open it. What you'll see are the three programs and this ReamMe.txt file. Drag the programs to where you want them on your computer. It's your choice. I keep all my Applescripts in a single folder under my name. I keep executables like the "Shell" script and "Ruby" program in my $HOME directory, where they are designed to be executed. If you don't put the two "keychain" programs in your $HOME, then you'll have to make appropriate changes to references to $HOME in the "keychains.sh" Shell script. You don't need the "admin" script, but I find it to be very handy. If you want it, get it from Google Sites: Admin.Scripts

The main thing you execute is the "keychain.sh" file. Most likely, that will cause a dialog box to appear telling you Keychain Access needs permission to access a keychain entry. You may have several hundred of them, and you don't what to have to click the "Allow" button hundreds of times. That's where the Click.Allow.applescript comes into the picture. Just double-click it to launch either the Script Editor, or AppleScript Editor. Compile it, and Run it. The first thing it will tell you is to click the dialog box that was put up by Keychain Access. Just click the title-bar, and sit back. The applescript will click "Allow", and continue to do that until Keychain Access stops putting up those dialog boxes.

When that's finished, the Ruby program is run by keychain.sh, and it converts the encoded result into a "keychain.csv" file. That file is a plain text file suitable for spreadsheet programs. The fields are the entry's Name, associated URL, Username, Password, and Date/Time stamp. I find this very handy when trying to find what Password is associated with a given Internet site. I hate having to visit Keychain Access to get that information, and enter by local user password to access the entry when I click on "Show Password", and then have to respond to an Allow/Deny dialog as well.

BTW. All of the automated "Allow" clicks are associated with the "security" user, not yourself. The result is that you'll still have to deal with Keychain Access entries as I described above. So if you want to "Always Allow" the security agent to have access, you can change the phrase in the applescript to "Always Allow" instead of just "Allow", and you won't have to use the applescript program again when creatng a "keychain.csv" file, except for a few new entries, and you can take care of them by just clicking the "Always Allow" button the next time you run keychain.sh ....

Contact Dick Guertin