Beijing is signaling that it is ready for a trade showdown, and it is building up a legal arsenal in preparation.