def load_certificate_request(type, buffer):
 if isinstance(buffer, _text_type):
  buffer = buffer.encode('ascii')
 bio = _new_mem_buf(buffer)
 if (type == FILETYPE_PEM):
  req = _lib.PEM_read_bio_X509_REQ(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
 elif (type == FILETYPE_ASN1):
  req = _lib.d2i_X509_REQ_bio(bio, _ffi.NULL)
 else:
  raise ValueError('type argument must be FILETYPE_PEM or FILETYPE_ASN1')
 _openssl_assert((req != _ffi.NULL))
 x509req = X509Req.__new__(X509Req)
 x509req._req = _ffi.gc(req, _lib.X509_REQ_free)
 return x509req

def load_certificate_request ( type , buffer ) : if isinstance ( buffer , _text_type ) : buffer = buffer . encode ( 'ascii' ) bio = _new_mem_buf ( buffer ) if ( type == FILETYPE_PEM ) : req = _lib . PEM_read_bio_X509_REQ ( bio , _ffi . NULL , _ffi . NULL , _ffi . NULL ) elif ( type == FILETYPE_ASN1 ) : req = _lib . d2i_X509_REQ_bio ( bio , _ffi . NULL ) else : raise ValueError ( 'type argument must be FILETYPE_PEM or FILETYPE_ASN1' ) _openssl_assert ( ( req != _ffi . NULL ) ) x509req = X509Req . __new__ ( X509Req ) x509req . _req = _ffi . gc ( req , _lib . X509_REQ_free ) return x509req
load a certificate request from a buffer .