Rex Tillerson has been promised more than 2 million shares of ExxonMobil -- worth $184 million at today's prices.

But his nest egg poses a difficult ethical and legal problem for Tillerson, who President-elect Donald Trump has picked as his secretary of state.

Federal law prohibits government employees from taking actions that could affect their personal stock holdings. As currently laid out in company documents, Tillerson is set to get ownership of the 2 million shares over the next decade.

The nation's chief diplomat could have a tremendous impact on Exxon's business, from negotiations over a climate change treaty and sanctions on Russia to the nuclear deal with Iran and general geopolitical unrest in the Middle East.

"There's too much the state department does that affects the oil industry," said Richard Painter, a former ethics lawyer for President George W. Bush. "It's not workable to have a secretary of state sitting on a bunch of oil company stock."

On top of the 2 million future shares in Exxon, Tillerson already has about 600,000 shares. Those would be relatively easy to dispense with. He can sell them and put the money in investments approved by the government, such as mutual funds. A federal tax provision even allows him to defer any potential capital gains taxes when he sells.

Related: Donald Trump's latest vague pledge - No 'new' business deals

The trickier part of Tillerson's case are the shares he has been promised. Under the company's rules, he's due to receive a chunk of stock every year for the next decade.

That's where the potential for conflicts comes in: Tillerson would know the schedule for when he is due to receive those shares, and his actions in office could influence their value.

"It's a crime to participate in any government action that has predictable effect on your investment holdings," Painter said.

To avoid that problem, or the prospect that Tillerson would forfeit the 2 million shares, Exxon (XOM) could change its rules and give Tillerson the stock when he leaves the company.

But that would be a tremendous favor for the future secretary of state, a move that in itself could raise ethical and conflict of interest questions. A spokesman for ExxonMobil wouldn't comment if the company is considering such a change.

Or Trump could grant Tillerson a waiver from having to follow the conflict of interest laws, a step he could legally do once he is in office. But that option too would just further arm critics concerned about potential conflicts.

Of course, Tillerson could walk away from the 2 million shares. He could still sell the 600,000 shares he already controls -- currently worth about $55.6 million. But he would be giving up a pot of money worth $184 million in today's prices.