At the same time Gen. Keith Alexander was running the National Security Agency, the United States’ biggest spying outfit, he was also trading stocks in an obscure technology company that had a sweetheart deal with one of the NSA’s most important sources of intelligence—the global phone and Internet giant AT&T.

In 2008, Alexander bought and sold tens of thousands of dollars in stock in a company called Synchronoss Technologies Inc., based in Bridgewater Township, N.J., according to the retired Army general’s financial-disclosure forms. You’ve probably never heard of Synchronoss, but, like the NSA, it probably knows who you are. If you’ve ever activated a new iPhone or synced your personal information across multiple devices—such as your phone, and your home and office computer—there’s a chance that Synchronoss’s technology helped make it happen. The company’s customers are some of the largest telecommunications service providers in the world—including AT&T, Verizon, Comcast, and Time Warner Cable—along with their more than 3 billion mobile subscribers.

Back when Alexander was an investor, Synchronoss was providing the technology that activated and “locked” all new Apple iPhones onto AT&T’s network. The carrier was then the exclusive voice and data service provider for the popular new iPhone, so Alexander stood to profit every time someone bought an iPhone and automatically became an AT&T customer.

The NSA also had its own special relationship with AT&T. Under secret court orders, the agency was then hoovering up the phone records of AT&T’s subscribers and pouring them into a database of who called whom in the United States, stretching back several years. After the 9/11 terrorist attacks, the NSA also had secretly installed communications surveillance equipment in some of AT&T’s offices, under orders from President George W. Bush. AT&T is arguably the most important source of communications for the NSA’s eavesdroppers because the company owns and operates a huge portion of the United States mobile, landline, and Internet infrastructure.

The deal between AT&T and Synchronoss wasn’t a secret, but Alexander’s financial stake in it was. The NSA only handed over his financial-disclosure forms showing that he was an investor in October, following a lawsuit by investigative journalist Jason Leopold. The agency initially had claimed that revealing any of Alexander’s investments could jeopardize national security.

A government ethics officer reviewed Alexander’s stock portfolio, which included shares in other tech companies as well as ordinary mutual funds, and certified that his “financial interests or affiliations are unrelated to assigned or prospective duties, and no conflicts appear to exist.” But there’s no indication of what supporting documents or other materials were used to arrive at that conclusion, or why Synchronoss, whose business is predicated on communications information, was deemed “unrelated” to Alexander’s duties as the head of a spy agency that collects such information.

Some of Alexander’s other stock investments have come under scrutiny in recent weeks, raising questions about whether the former NSA director was using information he gleaned in the course of his official duties to influence his stock picks. Alexander was buying and selling shares in companies that manufacture potash, a mineral whose production is dominated by a cartel of companies in Belarus and Russia, one of the NSA’s primary spying targets. And he also owned stock in a huge Chinese state-owned aluminum manufacturer at the same time his agency was monitoring Chinese hackers who were, in turn, spying on American aluminum companies.

Alexander also drew flak after opening a cybersecurity consulting firm earlier this year and filing for patents on new technologies that were informed by his time as the head of the NSA. Rep. Alan Grayson (D-FL) has questioned how Alexander could be charging his clients frees of reportedly between $600,000 and $1 million per month “unless he discloses or misuses classified information.”

Some of Alexander’s former colleagues also have come in for scrutiny. The NSA opened an inquiry last month into a deal that Alexander struck with Patrick Dowd, the agency’s chief technology officer, that would have allowed Dowd to work part-time both for the NSA and Alexander’s company, IronNet Cybersecurity Inc. Alexander canceled the deal after the Senate Intelligence Committee said it, too, wanted details about whether the plan would create a conflict of interest, Reuters reported. Also last month, another senior NSA official, Teresa Shea, announced she was leaving the agency after BuzzFeed reported that an intelligence consulting company was incorporated at Shea’s home. Her husband, James, also was linked to the company.

Against that backdrop, Alexander’s financial-disclosure forms have offered a rare peek into the private dealings of one of America’s most powerful intelligence officials. But they provide scant details about why Alexander bought and sold shares when he did, or even how much. In 2008, the earliest year for which the NSA would release any information, his investment in Synchronoss was valued between $15,001 and $50,000. Alexander didn’t respond to a request for comment about his stock transactions.

The records do show, however, that Alexander seemed to be watching Synchronoss closely, and particularly its exclusive deal with AT&T.

Activating iPhones promised a lucrative, steady revenue stream for Synchronoss. But not long after customers bought the first iPhones, in 2007, they started “jailbreaking” their devices and activating them on the networks of AT&T’s competitors. Synchronoss only got paid when a customer activated on AT&T, so each of those jailbreakers was costing Synchronoss money.

Enter Alexander, savvy investor. On May 6, 2008, Synchronoss announced that it had “materially lowered our growth expectations” for the year “due in large part to reduced revenues associated with the iPhone,” the company said in a statement. Synchronoss’s stock price plummeted on the news, down 43 percent in trading the next day. That’s when Alexander snatched up shares totaling between $1,001 and $15,000, his financial-disclosure forms show.

It's hard to know how much Alexander may have profited from his investment in Synchronoss. The disclosure forms indicate that he made less than $201 in 2008, meaning he either effectively broke even or potentially lost money. But the NSA refused to release any older disclosure forms that would show what Alexander made—or lost—in years prior. In 2009, he appears to have sold all his shares in the company. And as far as Synchronoss knows, Alexander was just another investor. “We are not aware of any relationship between the company and either Keith Alexander or the NSA,” Stacie Hiras, a spokeswoman for Synchronoss, told The Daily Beast.

Financial experts who examined Alexander’s disclosure forms said it wasn’t possible to know, given the limited information the NSA had provided, why Alexander had bought and sold shares when he did. But the records do show that Alexander was interested in some big companies outside the tech sector. And he wasn’t the only one.

On Jan. 7, 2008, Alexander sold shares in the Aluminum Corporation of China Ltd., also known as Chinalco, a state-owned enterprise based in Beijing that’s now the second-largest producer of aluminium in the world. Less than a month later, Alcoa, the American aluminum giant, announced a strategic partnership with Chinalco to buy a $14 billion stake in Rio Tinto, as part of an effort to derail a hostile bid by another firm for the world’s third-largest mining company.

U.S. investigators now believe that three weeks after the partnership was struck, Chinese computer hackers working for the People’s Liberation Army began spying on Alcoa in order to steal proprietary information that would benefit Chinalco and give the Chinese government an insight into the negotiations. The intruders made off with nearly 3,000 email messages and more than 800 attachments related to the deal. (Federal prosecutors spelled out the allegations in an indictment that refers to an anonymous Chinese state-owned enterprise, but it leaves virtually no doubt that the company is Chinalco.)

In other words, at the same time Alexander was selling off his stake in Chinalco, U.S. intelligence was monitoring Chinalco and keeping tabs on other Chinese cyberspies. Indeed, just a few months after the hacking campaign against Alcoa began, the NSA’s former inspector general gave an interview to National Journal, in which he blamed China for a massive campaign of cyberespionage against several U.S. companies, stealing trade secrets and proprietary information “in volumes that are just staggering.”

Alexander was investing in a company that was in the crosshairs of his own agency’s surveillance operations. If that had been known at the time, it would have raised questions about conflicts of interest and why the head of the NSA was taking personal stakes in a Chinese company.

Another of the companies in which Alexander invested at the time also drew the attention of Chinese cyberspies. On the same day he sold his shares in Chinalco, Alexander also sold his position in the Potash Corp. of Saskatchewan, a Canadian firm that mines potash, a mineral typically used in fertilizer. A few years later, Chinese hackers broke into the networks of seven of the company’s law firms as part of an effort to scuttle a takeover of the potash company by BHP Billiton Ltd., the same company that had been trying to take over Rio Tinto. (Bloomberg first reported the hacking.)

It’s not clear if the Chinese spied on the Potash Corp. of Saskatchewan directly before hitting its lawyers, said Anup Ghosh, the CEO of Invincea, a cybersecurity software company in Virginia that examined the hacking of the law firms. But, he added, “There’s a lot of evidence that this is an intelligence-collection capability China has launched. These methods are being used to feed Chinese intelligence.”

That, of course, is something that the NSA knew full well at the time Alexander was in charge of the agency, and when he was deciding which stocks to buy and sell.