On Sun, Dec 14, 2003, [EMAIL PROTECTED] wrote: > Hi.. > > I am using crypto library of openssl. I need to generate a RSA key using > RSA_generate_key() and then store the key into a file and later read it from a > file when I need it. > As far as my knowledge of openssl goes... I generate the key, store it in a file > using RSA_print_fp() which stores the key in a formatted fashion. Then if I > want to use it, I read the file again and parse the contents of the file to get > the key back. >
No that's not the way to do it. There's no opposite of RSA_print_fp() which will takes its human readable output and convert back to an RSA structure. > Is there any other easy way to do it? Can I just export the key to a file and > import it back from the file ? Please let me know. > The PEM functions are one way to go. These can be used to encrypt the private key with a passphrase too, since its very sensitive data. Check out the PEM manual pages for more info. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Funding needed! Details on homepage. Homepage: http://www.drh-consultancy.demon.co.uk ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]