That was what happened when federal investigators battled with the company over iPhone encryption after the mass shooting in San Bernardino, Calif., that killed 14 people in 2015. In that case, the government was trying to get Apple to “break” the protection of the suspect’s phone by demanding it create what Apple called in a court filing a “GovtOS” (that is, a government operating system), giving it that metaphorical key to a backdoor to all phones. The F.B.I. director at the time, James Comey, and President Barack Obama pressed Apple to help it crack into a device that one of the gunmen had owned.

The Apple chief executive, Tim Cook, refused to do it, in what was probably the most difficult decision of his career. He stuck to the principle espoused by his predecessor, the Apple founder Steve Jobs, who had long maintained that the ultimate act of patriotism is to protect the privacy of Apple customers against unnecessary search and seizure.

Over the years, Apple has increased security for consumers through encryption. In the most simple terms, phones were built to be opened only with a user’s passcode (this tech is also what enables fingerprint and face identification), and the company has built in no power to bypass that. The iPhone has been engineered to offer more and more user control.

That’s why Apple would not bend in the San Bernardino case. In the end, reports say, an Israeli firm unlocked the phone for the government, and the collision between Apple and the F.B.I. was averted.

In the Pensacola case, Apple has said it has given up all the data it has to the government. But law enforcement officials, as all law enforcement officials tend to do, are asking for more, claiming this time that they want only to look at the particular phones in the Pensacola case, and are not seeking a back door for all phones or a special operating system.

The problem? There is no breaking into a single phone without showing the government how to break into all iPhones.

While public safety is important, we have to ask whether getting into these phones is the only avenue the government has to pursue justice or find the truth. We must trust our public officials with confidential and sensitive information to allow them to do their jobs. But the need to guard users’ data — especially in an age when hackers and more autocratic governments can use it for more nefarious reasons — still trumps the public-safety concerns Mr. Barr is raising.