shizumi wrote:
Hi, i have a problem in RSA encryption. i create some application, that can encrypt or decrypt text with RSA. i generate key and encrypt the text to chipher text. can we save the private key in string without create file? if its's possible, can you tell me how to save it? thanks
One general way is to use the BIO_mem to write to memory instead of a file: bp = BIO_new(BIO_s_mem()); PEM_write_bio_RSAPrivateKey(bp,key.rsa,... /* You could write other objects here too. */ length = BIO_pending(bp); value = (char *) malloc(length); BIO_read(bp,value, length); BIO_free(bp); -- Douglas E. Engert <[EMAIL PROTECTED]> Argonne National Laboratory 9700 South Cass Avenue Argonne, Illinois 60439 (630) 252-5444 ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [email protected] Automated List Manager [EMAIL PROTECTED]
