Difference between revisions of "BIO"

From OpenSSLWiki
Jump to navigationJump to search
(copied the content that I wrote about BIOs from the OpenSSL wikibook)
 
(Modified manual links to point to the wiki manual pages)
Line 3: Line 3:
 
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.
 
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 [https://www.openssl.org/docs/crypto/BIO_read.html BIO_read] and <code>BIO_gets</code>.
+
Reading from a BIO can be done with [[Manual:BIO_read(3)]] and <code>BIO_gets</code>.
  
 
Writing to a BIO can be done with <code>BIO_write</code>, <code>BIO_puts</code>, <code>BIO_printf</code>, and <code>BIO_vprintf</code>.
 
Writing to a BIO can be done with <code>BIO_write</code>, <code>BIO_puts</code>, <code>BIO_printf</code>, and <code>BIO_vprintf</code>.
Line 9: Line 9:
 
== Filter BIOs ==
 
== Filter BIOs ==
  
* [https://www.openssl.org/docs/crypto/BIO_f_base64.html BIO_f_base64]
+
* [[Manual:BIO_f_base64(3)]]
* [https://www.openssl.org/docs/crypto/BIO_f_buffer.html BIO_f_buffer]
+
* [[Manual:BIO_f_buffer(3)]]
* [https://www.openssl.org/docs/crypto/BIO_f_cipher.html BIO_f_cipher]
+
* [[Manual:BIO_f_cipher(3)]]
* [https://www.openssl.org/docs/crypto/BIO_f_md.html BIO_f_md]
+
* [[Manual:BIO_f_md(3)]]
* [https://www.openssl.org/docs/crypto/BIO_f_ssl.html BIO_f_ssl]
+
* [[Manual:BIO_f_ssl(3)]]
  
 
== Source/sink BIOs ==
 
== Source/sink BIOs ==
  
* [https://www.openssl.org/docs/crypto/BIO_s_accept.html BIO_s_accept]
+
* [[Manual:BIO_s_accept(3)]]
* [https://www.openssl.org/docs/crypto/BIO_s_bio.html BIO_s_bio]
+
* [[Manual:BIO_s_bio(3)]]
* [https://www.openssl.org/docs/crypto/BIO_s_connect.html BIO_s_connect]
+
* [[Manual:BIO_s_connect(3)]]
* [https://www.openssl.org/docs/crypto/BIO_s_fd.html BIO_s_fd]
+
* [[Manual:BIO_s_fd(3)]]
* [https://www.openssl.org/docs/crypto/BIO_s_file.html BIO_s_file]
+
* [[Manual:BIO_s_file(3)]]
* [https://www.openssl.org/docs/crypto/BIO_s_mem.html BIO_s_mem]
+
* [[Manual:BIO_s_mem(3)]]
* [https://www.openssl.org/docs/crypto/BIO_s_null.html BIO_s_null]
+
* [[Manual:BIO_s_null(3)]]
* [https://www.openssl.org/docs/crypto/BIO_s_socket.html BIO_s_socket]
+
* [[Manual:BIO_s_socket(3)]]

Revision as of 21:11, 7 May 2013

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 Manual:BIO_read(3) and BIO_gets.

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

Filter BIOs

Source/sink BIOs