sorry, I misunderstand your request " for internal processing". the previous 
functions which I memtioned can't be processing.

I think this will be better.

RSA *pub_key = NULL;
    pub_key = readPublicKey(); // to read a public key from a file ,you can use 
your own function to get a rsa object
    BIO *mem = BIO_new(BIO_s_mem());
    RSA_print(mem,pub_key,0);
    unsigned char buf[1024*10];
    BIO_read(mem,buf,1024*10);
    printf("%s \n",buf);

BUF_MEM *bio_buf=NULL;
BIO_get_mem_ptr(mem,&bio_buf);


I recommend you to use a memory BIO to store the rsa data. You can use it like 
a common BIO or you can get it's internal string use BIO_get_mem_ptr.
 
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

Reply via email to