TAMPA, Fla. (KMGH) -- A Tampa man found himself in jail for 44 days after he ignored a judge’s order to give police his cell phone passcode so officers could search the phone.

William Montanez failed to use his blinker last June and officers pulled him over for it. They smelled pot in his car, his attorney says.

"He said, 'Yes, I smoke marijuana. There is marijuana in the vehicle," says Patrick Leduc, Montanez’s attorney.

During the traffic stop, Leduc says a text message popped up on one of his client’s two phones that read, “OMG. Did they find it?"

It made police interested in what else was on his phone.

"They went to a judge and law enforcement got a search warrant,” Leduc recalls. “They showed up at my client's house days later and said, ‘We demand that you give up the pass codes to these phones.’"

When Montanez refused to give up the passcode in court, a judge ordered him sent to jail on contempt of court.

"I think the judge was completely wrong," Leduc says.

What are your rights in this situation?

The public has the right to ask police to get a warrant, approved by a judge, before police search your home, for example. Most times they need a warrant to search your vehicle, but some states officers can search a car if they feel the need for safety or to inventory a vehicle if the driver or owner is arrested.

Police have the right to take your fingerprints and mug shots and, therefore, most law enforcement agencies believe they are allowed to unlock your cell phone if your face is the password or if you use a fingerprint to unlock it.

But police asking you to give them your actual passcode of numbers or letters is different. You’re being forced to give police a statement, some lawyers believe.

The issue has created debate among those in legal circles.

Defendant’s lawyer

"This was a complete fishing expedition," Leduc says.

He believes what police and a judge did was “completely out of line.”

“There's no probable cause to suggest that just because you have a misdemeanor amount of marijuana in your possession that there is evidence of a crime in a cell phone," he says.

After 44 days in jail, an appeals court ordered the release of Montanez.

His lawyer says making him tell police his password would have amounted to him giving up evidence on himself and admitting the phone was his.

"If there is information on that cell phone, then I would have just been ordered by a court to violate my Fifth Amendment right to remain silent, to not offer information that would incriminate me," Montanez says.

Civil rights attorney

Denver civil rights attorney David Lane believes this issue will eventually come up in Colorado.

"Absolutely. I mean it's going to happen everywhere," Lane says.

His view? We should all be worried.

"This is the death of privacy in the digital age. This is forced self-incrimination," Lane says.

18th Judicial District Attorney

Colorado 18th Judicial District Attorney George Brauchler, who covers counties just south of Denver, says he probably wouldn't demand a passcode.

"I think it's incredibly unlikely. That just is not Colorado,” he says. “That's just not how we've done business in the past, and as long as we have another vehicle to get that information – which is by going to the court and getting a search warrant and then turning it over to the experts in technology – I don't think we need to go down that road.”

His office has used the services of private companies and devices that are able to hack nearly every cell phone by using proprietary technology. The need to demand a passcode hasn’t arisen, he says.

Brauchler says people should consider helping police by giving them access when requested but says when his prosecutors ask a judge for a warrant, they are usually required to narrow the scope of the request.

Prosecutors might ask for videos from only a few days or Facebook information for a short and defined time period.

Police can make you give up your fingerprint or open your phone with your face because you're not forced to say anything, he says.

Brauchler said the 18th Judicial District in Colorado gets warrants for cell phones several times a week.

The Denver Police Department provided numbers showing it has searched 237 phones from the beginning of the year through June 27. From March to December of 2018, the department searched 344 devices.

"I think the information on a cell phone is more valuable than being able to search someone's house or computer," said Metropolitan State University of Denver criminal justice professor Stacey Hervey.

She says courts haven’t definitively ruled on the passcode issue everywhere.

"I think it's an issue where legal precedent really isn't keeping up with what police officers are trying to do with technology," she says.

It’s her view that the issue stands a strong change of making it to the U.S. Supreme Court. This story originally appeared on KMGH.com.