Cc: openssl-users@openssl.org
Subject: Re: Base64 Help
// Set up a base64 encoding BIO that writes to a memory BIO.
BIO* b64 = BIO_new(BIO_f_base64());
BIO* out = BIO_new(BIO_s_mem());
BIO_set_flags(out, BIO_CLOSE); // probably redundant
b64 = BIO_push
// Set up a base64 encoding BIO that writes to a memory BIO.
BIO* b64 = BIO_new(BIO_f_base64());
BIO* out = BIO_new(BIO_s_mem());
BIO_set_flags(out, BIO_CLOSE); // probably redundant
b64 = BIO_push(b64, out);
// Send the data.
// e.g., i2
On Mon, Oct 17, 2005, Adam Jones wrote:
> int main (void)
> {
> BIO *bmem, *b64;
> BUF_MEM *bptr;
> char message[] = "Hello World \n";
> int written = 0;
>
> b64 = BIO_new(BIO_f_base64());
> bmem = BIO_new(BIO_s_mem());
> b64 = BIO_push(b64, bmem);
> written = BIO_write(b64, message, str
p;bptr); to
BIO_get_mem_ptr(bmem, &bptr); which does nothing.
Thanks in Advance...
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joseph Oreste Bruni
Sent: Thursday, October 13, 2005 4:36 PM
To: openssl-users@openssl.org
Subject: Re: Base64 Help
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joseph Oreste
Bruni
Sent: Thursday, October 13, 2005 2:46 PM
To: openssl-users@openssl.org
Subject: Re: Base64 Help
"b64" is a filter BIO, it won't hold on to your data. You need to
append a
&q
Adam Jones wrote:
Visual C++ did not complain nor did it error out when it ran, but you are
correct it does take a BUF_MEM structure. I also added another BIO method to
the code. I also read that section in the book you suggested. I also made
the code simple, but it appears that it still does not
ge, strlen(message));
cout << written << endl;
BIO_flush(b64);
BIO_free_all(b64);
}
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joseph Oreste Bruni
Sent: Thursday, October 13, 2005 2:46 PM
To: openssl-users@openssl.o
"b64" is a filter BIO, it won't hold on to your data. You need to
append a "memory BIO" to the back end of the filter bio so that your
output can be accumulated.
There are samples on how to do this in the OpenSSL book as well as a
rather lengthy discussion on BIO's in general.
Also "BIO_g