def dump_certificate(type, cert):
 bio = _new_mem_buf()
 if (type == FILETYPE_PEM):
  result_code = _lib.PEM_write_bio_X509(bio, cert._x509)
 elif (type == FILETYPE_ASN1):
  result_code = _lib.i2d_X509_bio(bio, cert._x509)
 elif (type == FILETYPE_TEXT):
  result_code = _lib.X509_print_ex(bio, cert._x509, 0, 0)
 else:
  raise ValueError('type argument must be FILETYPE_PEM, FILETYPE_ASN1, or FILETYPE_TEXT')
 return _bio_to_string(bio)

def dump_certificate ( type , cert ) : bio = _new_mem_buf ( ) if ( type == FILETYPE_PEM ) : result_code = _lib . PEM_write_bio_X509 ( bio , cert . _x509 ) elif ( type == FILETYPE_ASN1 ) : result_code = _lib . i2d_X509_bio ( bio , cert . _x509 ) elif ( type == FILETYPE_TEXT ) : result_code = _lib . X509_print_ex ( bio , cert . _x509 , 0 , 0 ) else : raise ValueError ( 'type argument must be FILETYPE_PEM, FILETYPE_ASN1, or FILETYPE_TEXT' ) return _bio_to_string ( bio )
dump a certificate to a buffer .