[Answered ]-Can python access an RSA private key stored locally in a keystore like seahorse / Apple Keychain

0πŸ‘

βœ…

On Mac OS X, the keychain can be accessed from the shell using the security program. You can search for a specific private key using security find-identity -s <search term>, and export it to a file using security export (more information on those commands can be obtained from security -h <command>). I have not seen python bindings yet, but it should be easy to wrap the functionality you need in a subprocess.call call.

πŸ‘€Simon

2πŸ‘

Yes, it can there are a couple solutions for this, but so far the best one I’ve found is keyring.

The Python module keyring supports OSX, Windows and both Gnome keyring and KDE wallet. Just tried it out on OSX and pleasantly had no problems right out of the box. Much respect to its’ author Jason R. Coombs.

The source code lives at http://bitbucket.org/kang/python-keyring-lib, but
pip install keyring works too.

Leave a comment