The fglpass tool
The Genero Web Services package provides a command line tool called fglpass. The fglpass tool can encrypt a password from a X.509 certificate or a RSA private key. The encrypted password is displayed on the console in a Base64 form, composed only of alphanumeric characters, and therefore easily usable in any text file.
See fglpass for more details.