(CN) – A man suspected of voyeurism can be compelled to tell police his four-digit iPhone passcode so they can search it for incriminating photos, a Florida appeals court ruled.

Aaron Stahl was arrested after a woman who was shopping in a store saw him crouch down and extend an illuminated cellphone under her skirt, according to court records.

When she confronted him, Stahl told her he had dropped his phone. He ran out of the store when she yelled for help, but police were able to identify him using his car’s license plate number. He was arrested for third-degree voyeurism.

In a police interview, Stahl initially gave verbal consent to a search of his cellphone, an Apple iPhone 5, but withdrew his consent before telling police his four-digit passcode.

Once police obtained a warrant for the phone, they were still unable to access the photos on the phone.

Without the passcode, which is known only to the user, even Apple cannot extract the data from the phone because the encryption key is tied to the passcode. After 10 failed attempts to enter the passcode, the phone will lock and potentially erase its contents.

A trial judge denied the state’s motion to compel Stahl to give up his passcode, finding that it would be tantamount to forcing him to testify against himself in violation of the Fifth Amendment.

But the Florida Court of Appeal’s Second District reversed Wednesday, finding that the passcode is not related to any criminal photos or videos found on the phone.

“Providing the passcode does not ‘betray any knowledge [Stahl] may have about the circumstances of the offenses’ for which he is charged,” Judge Anthony Black said, writing for the three-judge panel. “Thus, ‘compelling a suspect to make a nonfactual statement that facilitates the production of evidence’ for which the state has otherwise obtained a warrant based upon evidence independent of the accused’s statements linking the accused to the crime does not offend the privilege.”

In the U.S. Supreme Court’s 1988 Doe v. U.S. decision, Justice John Paul Stevens wrote a since much-repeated line, saying that an accused person may be “forced to surrender a key to a strongbox containing incriminating documents,” but cannot “be compelled to reveal the combination to his wall safe.”

The trial judge similarly found that Stahl could not be forced to use the “contents of his mind” to unlock the phone.

The appeals court, however, questioned this reasoning, which would grant protections for cellphone users that use a passcode, but not for those who use a fingerprint to unlock their phone.

“We question whether identifying the key which will open the strongbox – such that the key is surrendered – is, in fact, distinct from telling an officer the combination,” Black said. “More importantly, we question the continuing viability of any distinction as technology advances.”

Black concluded, “Unquestionably, the State established, with reasonable particularity, its knowledge of the existence of the passcode, Stahl’s control or possession of the passcode, and the self-authenticating nature of the passcode. This is a case of surrender and not testimony.”