Hi all.

Apologies if the following code is weird, I am new to open-ssl, all 
suggestions welcome :-)

I need to copy some private key information into memory, and I am using 
a BIO for this. Code is as follows :

   key=BIO_new(BIO_s_mem());
   buffer=BUF_MEM_new();
   BIO_set_mem_buf(key, buffer, BIO_CLOSE);
  

   fprintf(stderr, "dumping key data to buffer\n" );
   BN_print(key, rsa->n);
   /*... more stuff here...*/
   BN_print(key, rsa->iqmp);

///// I need to print the content of key here, stderr will do 
fine..../////////

   fprintf(stderr, "destroying key blocked IO\n" );
   BIO_free(key);
   fprintf(stderr, "done\n");

Questions :
1/ when the buffer is allocated, do I need to specify the memory size to 
use ? Or is it like c++ for example, when a push_back will resize the data ?
2/ Does anyone know any <convenient> way to get the (BIO) key printed 
(sample please !!!!) ?
3/ May seem trivial, but does anyone know about a reference (html, ps, 
pdf, ...) that would give a better overview of the code ??

Thanks for your help,

Vincent

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to