Robert Peston: How will Trump react to Johnson blocking him over Huawei?

There is a contradiction at the heart of today's government decision to allow UK telecoms companies to purchase kit from China's Huawei for their 5G and full fibre broadband networks.

It is that Huawei has been has been officially designated as a "high risk vendor" - because it is seen by ministers as subject to direction by an anti-democratic Chinese government and its surveillance apparatus.

But - despite pressure from President Donald Trump for Huawei to be banned altogether from the UK's digital infrastructure - Boris Johnson and the National Security Council have not chosen to instruct Huawei to pack up their hi-tech kit and flog it in other parts of the globe.

Instead they decided to give Huawei restricted access to the new 5G and super-fast broadband networks - which Johnson felt obliged to do, because he is convinced that banning Huawei would have set back the development of 5G and super-fast broadband by two to three years, at a potential economic cost of tens of billions of pounds (or so officials informed him).

But Huawei will not be allowed to install any kit in the so-called core of these networks, which is where most data is processed and important functions such as encryption of messages takes place.

Also Huawei kit will not be permitted anywhere near critical services, like power stations, or high-security locations, such as military bases.

But telecoms companies will be allowed to buy Huawei equipment for up to 35% of the non-core or peripheral parts of their respective networks - which is where their most expensive investment is made, because it includes all those masts and base stations that you see on top of buildings, bus-stops and lamp posts.

In theory, this limit of 35% and prohibition from the core should reduce two significant risks.

First, if Huawei equipment stopped working - either as deliberate sabotage or by accident - the UK's critical digital infrastructure would continue to function (though obviously at significantly reduced capacity).

And second, China should not be able to harvest or steal either valuable "big" data or secrets from the UK, because at the periphery this information should not be available to them (and I should point out that UK security officials say they have never detected any malicious conduct by Huawei in the UK via Huawei kit already installed in existing networks).

So has Johnson alighted on a compromise that will placate the American government (and Australia - which has a 100% ban on Huawei) and reassure senior Tory MPs such as Iain Duncan Smith and Tom Tugendhat?

Probably not - although the US position will be seen by many as disingenuous, because the digital channel of communication between the UK and US will remain wholly separate from any network where Huawei kit is present.

Boris Johnson has given Huawei the 5G go-ahead. Credit: PA/Huawei

The problem is that for 5G, important data processing - such as for a new generation of driverless cars - may well migrate outside of the core network to the periphery.

So if Huawei were to want to harvest valuable data, it could do so - possibly.

So the UK's world-leading security operations, GCHQ and the National Cyber Security Centre, will have to be vigilant to ensure Huawei will not through stealth find its kit being used for critical and sensitive services.

Which means that what really matters is that over time Huawei's share of the market falls.

And that can only happen if the government delivers on two important pledges; to bring other equipment providers into the UK (such as Samsung and NEC, and maybe one day a British supplier), and to make all equipment "interoperable" (so that non-Huawei kit can function if grafted on to equipment originally installed by Huawei).

What the PM has in effect announced is that previous governments made a dumb decision to allow Huawei to build such a big share of existing digital networks (almost two thirds of BT's and Vodafone's existing 4G networks).

What he is trying to do is gradually unwind the effect of that decision, without damaging the establishment of valuable super-fast digital services here.

But his plan thumbs the UK's nose at Donald Trump, who badly wants the UK to join with him in an economic war against China.

So Johnson will be just a little nervous about how Trump reacts to his Twitter feed - and diplomatic overtures - being blocked.

Johnson will expect to be trolled.