def _get_certificate_obj(cert):
 if isinstance(cert, M2Crypto.X509.X509):
  return cert
 text = _text_or_file(cert)
 text = get_pem_entry(text, pem_type='CERTIFICATE')
 return M2Crypto.X509.load_cert_string(text)

def _get_certificate_obj ( cert ) : if isinstance ( cert , M2Crypto . X509 . X509 ) : return cert text = _text_or_file ( cert ) text = get_pem_entry ( text , pem_type = 'CERTIFICATE' ) return M2Crypto . X509 . load_cert_string ( text )
returns a certificate object based on pem text .