In China’s communist-run political system, lines of control between Beijing and privately operated enterprises are murky. Some Chinese companies are owned directly by the government; all owe a level of fealty to the government.

That’s background for a spectacular legal confrontation now brewing between China and the United States over Huawei, China’s telecom giant. On Dec. 1, Canadian authorities fulfilled a U.S. government request to arrest Huawei’s chief financial officer amid allegations the company violated U.S. trade sanctions against Iran.

The pressure point runs much deeper than whatever U.S.-originated equipment Huawei may have sold to Iran. Huawei is described as the world’s largest supplier of cellular tower electronics and other telecommunications equipment. The firm is on the cutting edge.

All fine — global competition is welcome. Except almost everything related to telecommunications technology has potential military usefulness, including for espionage.

Huawei says it doesn’t answer to the government, doesn’t engage in espionage and complies with all applicable law. But the U.S. government is deeply suspicious of Huawei and its connections to the Chinese government. A 2012 congressional report concluded that Huawei and another firm, ZTE, provided “a wealth of opportunities for Chinese intelligence agencies to insert malicious hardware or software implants into critical telecommunications components and systems.”

The arrest may complicate the Trump administration’s trade negotiations with China. But this collision of interests will turn out to be a good test of Chinese intentions. Trade is one facet of a complex relationship. Both sides will be better off if President Donald Trump can negotiate a deal with Chinese President Xi Jinping without getting distracted by a criminal case that will proceed on the merits.

As for companies like Huawei, the Chinese government has a choice. It can encourage companies in sensitive industries to open themselves to outside scrutiny and investment. It also can insist that companies like Huawei respect the law — U.S. sanctions against Iran included. Or China can allow companies like Huawei to stay in the shadows, untrusted by the United States and other Western governments. There are plenty of other telecom companies willing to play by the rules.