def valid_csr(csr):
 try:
  req = OpenSSL.crypto.load_certificate_request(OpenSSL.crypto.FILETYPE_PEM, csr)
  return req.verify(req.get_pubkey())
 except OpenSSL.crypto.Error as error:
  logger.debug(error, exc_info=True)
  return False

def valid_csr ( csr ) : try : req = OpenSSL . crypto . load_certificate_request ( OpenSSL . crypto . FILETYPE_PEM , csr ) return req . verify ( req . get_pubkey ( ) ) except OpenSSL . crypto . Error as error : logger . debug ( error , exc_info = True ) return False
validate csr .