RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length); int i2d_RSAPublicKey(RSA *a, unsigned char **pp); RSA * d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, long length); int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp); RSA * d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length); int i2d_RSAPrivateKey(RSA *a, unsigned char **pp); int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()); RSA * d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)());
you can use these functions to convert the RSA structure into an asn1-der string array(i2d_xxx) and use d2i_xxx to convert an asn1-der string array to RSA structure. you can see the Openssl Doc for more details of these functions. At 2011-01-13 03:34:32,"Muneeswaran Raju" <hieswar...@gmail.com> wrote: Hi, I am able to generate the RSA private keys by "RSA_generate_key_ex". I need to store it into a buffer for internal processing. Can you please suggest me to convert RSA a key into buffer. I had seen the examples to dump into file. Instead of file processing I need to convert RSA private key into buffer. Thanks Muneeswaran.R