def _bio_to_string(bio):
 result_buffer = _ffi.new('char**')
 buffer_length = _lib.BIO_get_mem_data(bio, result_buffer)
 return _ffi.buffer(result_buffer[0], buffer_length)[:]

def _bio_to_string ( bio ) : result_buffer = _ffi . new ( 'char**' ) buffer_length = _lib . BIO_get_mem_data ( bio , result_buffer ) return _ffi . buffer ( result_buffer [ 0 ] , buffer_length ) [ : ]
copy the contents of an openssl bio object into a python byte string .