When the US was complaining that the Chinese firm Huawei had security backdoors, it knew this fact because it had put them there.
Huawei was banned from competing against US companies because these backdoors were apparently able to be used by the Chinese government to spy.
However according to papers discovered by Spiegel, the backdoors had been placed by the NSA as part of a major intelligence offensive against China.
The NSA made a special effort to target Huawei on behalf of US companies who were finding it hard to compete against the Chinese outfit.
At the beginning of 2009, the NSA began an extensive operation, referred to internally as "Shotgiant," against the company.
A special unit with the US intelligence agency succeeded in infiltrating Huwaei's network and copied a list of 1,400 customers as well as internal documents providing training to engineers on the use of Huwaei products, among other things.
NSA workers accessed the email archive, but also the secret source code of individual Huawei products. Beginning in January 2009 the NSA snuffled messages from company CEO Ren Zhengfei and Chairwoman Sun Yafang.
The NSA had such good access and so much data that it did not know what to do with it, states one internal document.
An NSA document said the justification for attacking Huawei was that "many of our targets communicate over Huawei produced products; we want to make sure that we know how to exploit these products".
It was also worried that "Huawei's widespread infrastructure will provide the PRC (People's Republic of China) with SIGINT capabilities". SIGINT is agency jargon for signals intelligence. The documents do not state whether the agency found information indicating that to be the case.
However, the NSA also indicates that that the Chinese were working to make American and Western firms "less relevant". That Chinese push is beginning to open up technology standards that were long determined by US companies, and China is controlling an increasing amount of the flow of information on the net.
The US was declaring that Huawei networks were unsafe while itself spying on the company.
In a statement, Huawei spokesman Bill Plummer criticised the spying measures saying that it was ironic that the US was "doing to us is what they have always charged that the Chinese are doing through us".
He also said that the US spying efforts prove that the NSA knew that the company is independent and has no ties to any government.