The shine on Apple is getting a little tarnished. Today, the SEC filed a suit against Gene Levoff, a lawyer who used to work for the iPhone giant, accusing him of insider trading, selling millions of dollars in stock ahead of earnings and saving himself some $382,000 in losses in the process, and, in a separate, earlier period, earning $245,000 in profits.

Levoff started to work for Apple in 2008, first as director of corporate law and then senior director. He was put on leave from Apple in July 2018, and his employment was terminated in September 2018.

The suit covers activities in 2015 and 2016, years when Apple saw a dip in performance before it roared back with a trillion-dollar market cap in 2017.

The news is especially ironic — although perhaps not surprising, considering the information Levoff had at his disposal: he had been the company’s senior director of Corporate Law and Corporate Secretary of Apple and was “responsible for ensuring compliance with the company’s insider trading policy and determining the criteria for those employees (including himself) restricted from trading around quarterly earnings announcements.”

It also worked in the other direction. The SEC alleges that Levoff also made trades in 2011 and 2012 also ahead of market-moving news that helped him make profits of $245,000.

The SEC is requesting that Levoff pay a civil monetary penalty, disgorging “an amount equal to the profits gained and losses avoided as a result of the actions described herein,” and that he be prohibited from serving as an officer or director of a public company.

The SEC suit covers trades on “at least” three occasions between 2015 and 2016, where Levoff would have had access to financial data before it was released to the public and subsequently made trades on that information.

One example in the suit notes that he sold $10 million in stock in July ahead of Apple reporting that it would miss expectations on iPhone sales.

The SEC makes a point of noting the disconnect between Levoff’s actions for his own gain and his role at the company. Among his duties was serving on Apple’s Disclosure Committee, “established to assist the Chief Executive Officer and Chief Financial Officer in fulfilling their responsibility for oversight of the accuracy and timeliness of disclosures made by Apple; determine Apple’s disclosure obligations and ensure information contained in Apple’s filings to the SEC and all other disclosures are timely, accurate, complete, and a fair representation of Apple’s financial condition and results of operations; and ensure that Apple’s disclosure controls and procedures are properly designed, adopted and implemented.”

Levoff was involved with some of the stealthier parts of Apple’s dealings. His name also appears with a number of Apple’s M&A deals, he once told U.S. lawmakers, investigating on legal documents of startups that Apple had quietly acquired in Europe.

He was also named in a 2013 investigation into Apple’s offshore accounts, where he noted to investigators that he served on the boards of some 70 Apple subsidiaries, including Apple Operations International, “a 30-year old corporation that has no employees or physical presence, and whose operations are managed and controlled out of the United States. Despite receiving $30 billion in earnings and profits during the period 2009 through 2011 as the key holding company for Apple’s extensive offshore corporate structure, Apple Operations International has no declared tax residency anywhere in the world and, as a consequence, has not paid corporate income tax to any national government for the past 5 years,” according a report about the offshore activities.

But in this current suit, the SEC makes a point of clearing Apple itself of wrongdoing in the specific case of insider trading, noting that the company took several steps to warn employees of blackout periods and general legal and illegal practices regarding trading and financial information (some of which Levoff himself even penned):