Apple CEO Tim Cook said it's unfortunate the FBI's case to force the company to provide data from a terrorist's iPhone in 2016 didn't go to trial because that way the public could have seen the truth.

Speaking on Tuesday at a Time Magazine conference in New York, Cook was referring to the case of the San Bernadino shooter, Syed Farook, who killed 14 people and injured 22 others at the Inland Regional Center. Apple publicly opposed the FBI when it asked for access to data Farook's work phone, saying that what law enforcement was requesting would be a "master key" capable of opening millions of iPhones

The case was dropped after the Department of Justice was able to access the iPhone days before an expected trial. The company or person who was eventually able to crack the iPhone's security has not been made public.

"Now, after the inspector general reports have come out, our worst fears have been confirmed — that it was a very rigged case to begin with," Cook said on Tuesday. "So I think this was not the government's finest hour. I have personally never seen the government apparatus move against a company like it did here in a very dishonest manner."

The government report that Cook referenced includes passages that suggest some departments within the FBI were close to gaining the ability to crack the iPhone 5C used by Farook at the time of the Apple case but, due to miscommunication, those capabilities were never mentioned in the legal battle with Apple.

FBI leaders worry that encryption technologies from tech companies could enable criminals to delete or scramble evidence on their phones or computers, putting the information out of the reach of law enforcement investigators.

Officials refer to it as the "going dark" issue. It's reached a stalemate in recent years as strong encryption features have been built into products from Apple, Google, Facebook, Microsoft and other big tech companies.

Last year, Cook said that Apple would fight the FBI again if the iPhone case happened a second time. On Tuesday, Cook also called for government regulations on privacy.

WATCH: FBI paid $1.3 million to hack iPhone