OpenSSL/Using BIOs

From Wikibooks, open books for an open world
Jump to navigation Jump to search

A BIO is an I/O stream abstraction; essentially OpenSSL's answer to the C library's FILE *. OpenSSL comes with a number of useful BIO types predefined, or you can create your own.

BIOs come in two flavors: source/sink, or filter. BIOs can be chained together. Each chain always has exactly one source/sink, but can have any number (zero or more) of filters.

Reading from a BIO can be done with BIO_read and BIO_gets.

Writing to a BIO can be done with BIO_write, BIO_puts, BIO_printf, and BIO_vprintf.