Manual Pages for UNIX Darwin command on man BIO_f_base64
MyWebUniversity

Manual Pages for UNIX Darwin command on man BIO_f_base64

BIOfbase64(3) OpenSSL BIOfbase64(3)

NAME

BIOfbase64 - base64 BIO filter

SYNOPSIS

#include

#include

BIOMETHOD * BIOfbase64(void);

DESCRIPTION

BIOfbase64() returns the base64 BIO method. This is a filter BIO that base64 encodes any data written through it and decodes any data read through it. Base64 BIOs do not support BIOgets() or BIOputs(). BIOflush() on a base64 BIO that is being written through is used to signal that no more data is to be encoded: this is used to flush the final block through the BIO. The flag BIOFLAGSBASE64NONL can be set with BIOsetflags() to encode the data all on one line or expect the data to be all on one line. NNOOTTEESS Because of the format of base64 encoding the end of the encoded block cannot always be reliably determined.

RETURN VALUES

BIOfbase64() returns the base64 BIO method. EEXXAAMMPPLLEESS Base64 encode the string "Hello World\n" and write the result to standard output: BIO *bio, *b64; char message[] = "Hello World \n"; b64 = BIOnew(BIOfbase64()); bio = BIOnewfp(stdout, BIONOCLOSE); bio = BIOpush(b64, bio); BIOwrite(bio, message, strlen(message)); BIOflush(bio); BIOfreeall(bio); Read Base64 encoded data from standard input and write the decoded data to standard output: BIO *bio, *b64, *bioout; char inbuf[512]; int inlen; b64 = BIOnew(BIOfbase64()); bio = BIOnewfp(stdin, BIONOCLOSE); bioout = BIOnewfp(stdout, BIONOCLOSE); bio = BIOpush(b64, bio); while((inlen = BIOread(bio, inbuf, 512) > 0) BIOwrite(bioout, inbuf, inlen); BIOfreeall(bio);

BUGS

The ambiguity of EOF in base64 encoded data can cause additional data following the base64 encoded block to be misinterpreted. There should be some way of specifying a test that the BIO can perform to reliably determine EOF (for example a MIME boundary).

SEE ALSO

TBA

0.9.7l 2003-05-18 BIOfbase64(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™