mem_bio_to_file
rv = mem_bio_to_file(mem_outpubkey, outpubkeyfile, outformat, private);
rv = mem_bio_to_file(mem_out, outfile, outformat, private);
int mem_bio_to_file(BIO *in, const char *filename, int format, int private);