ExxonMobil and Rex Tillerson have announced their plan to address concerns about the huge nest egg the oil giant has promised to its former CEO.

Tillerson, who Donald Trump has picked as his secretary of state, is due to receive more than 2 million Exxon shares -- worth more than $181 million at current prices -- over the next decade.

To tackle the ethical and legal problems raised by the massive payout, Exxon said late Tuesday that if Tillerson is confirmed for the job, it plans to put the value of the shares he would have received in an independently managed trust, which won't be allowed to invest in the oil company.

Tillerson, 64, has also agreed with the State Department to sell the more than 600,000 Exxon shares he owns at the moment, the company said. They're worth more than $54 million at today's prices.

Related: Exxon's Tillerson retiring to prep for Senate confirmation

Richard Painter, a former ethics lawyer for President George W. Bush, said the measures appeared to satisfy concerns he had expressed previously about Tillerson's financial ties to Exxon.

"He should convince President-elect Trump to come up with a similar arrangement to divest his conflicts of interest," Painter said, comparing Tillerson's deal to what was done for former Goldman Sachs CEO Hank Paulson when he became treasury secretary in 2006.

Tillerson's arrangement, which Exxon says was drawn up in consultation with federal ethics regulators, involves giving up various payouts and perks, according to the company's statement.

He'll no longer be entitled to more than $4.1 million in cash bonuses that he was set to receive over the next three years -- or medical, dental and other benefits from Exxon. He retired as the oil company's CEO on Saturday after working there for more than four decades.

As America's chief diplomat, Tillerson 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.

Exxon said that if Tillerson returns to work in the oil and gas industry during the 10-year payout period from the trust, he would forfeit the funds.

"The money would be distributed to one or more charities involved in fighting poverty or disease in the developing world," the company said. "Neither Tillerson nor ExxonMobil would have any control over the selection of the charities."

Painter described that part of the plan as "an added benefit" that will make it "highly unlikely" that Tillerson will go back into the oil industry.

"Most public servants have no restrictions on where they can work after government ... and we have to worry about them trying to help future employers," he said, pointing to Treasury Department officials who go back to Wall Street.

Related: The problem with Rex Tillerson's nine-figure nest egg

Over all, the arrangement would cost Tillerson about $7 million in compensation he would have received, Exxon said.

As with all political appointees who sell assets that may pose conflicts of interest, Tillerson would be allowed to defer any capital gains tax he owes on the more than 600,000 Exxon shares he's agreed to sell so long as he reinvests the proceeds within 60 days into so-called "permitted property." That basically means U.S. Treasury securities and diversified mutual funds.

It's not immediately clear, however, what the tax implications are for Tillerson from Exxon agreeing to set up the trust for the value of the more than 2 million shares he'd otherwise have coming to him over the next 10 years.

-- Jeanne Sahadi and Chris Isidore contributed to this report.