On Sat, Dec 28, 2002, Michel Bäumer wrote: > Needing public key encryption for an application, i took a look at > libcrypto. > The problem is coping with it... > > I'm trying to use the rsa-algorithm. > > How do I seperate the public and the private key? If I generate my key with > RSA_generate_key i'm getting a RSA* struct with both keys(a key pair). Now I > want to save the public key in one location, the private key in another. I > didn't find a function for it. > > Is my approach incorrect? First I tried to use EVP*-Functions, but i didn't > find any helpful documentation or tutorial(besides the spanish one in the > list-archive mentioned). > What is the easiest way to use public key cryptography with libcrypto? >
The relevant PEM functions will do the job. Things like: PEM_write_RSAPrivateKey and PEM_write_RSA_RSA_PUBKEY will do what you need. As for whether you should use the RSA functions directly or EVP it depends on what you actually want to do. Steve. -- Dr. Stephen Henson [EMAIL PROTECTED] OpenSSL Project http://www.openssl.org/~steve/ ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]