A UK court has reaffirmed the power for state agents to use sweeping counterterrorism legislation to require travelers hand over the passwords for their digital devices for their contents to be searched at borders.

A London court today found Muhammad Rabbani guilty of willfully obstructing the police by failing to hand over device passwords and the PIN code for his smartphone after he had been detained at a UK airport.

Rabbani is international director of Cage, an advocacy organization for communities impacted by Western counterterrorism policies.

He says he had been returning from a business trip to the Middle East last year when he was detailed and questioned. He declined to provide his passwords because he said he wanted to protect sensitive information provided to Cage by a client who had been subjected to torture.

The Intercept has reported at some length on the case after the same counterterrorism legislation was used in 2013 to detain David Miranda, the partner of Intercept co-founder and investigative journalist Glenn Greenwald who had been in contact with NSA whistleblower Edward Snowden. In that instance UK authorities seized journalistic material stored on a hard drive being carried through a UK airport by Miranda — apparently conflating journalism and terrorism.

The law being used by UK authorities to force people to provide access keys to their digital devices is Schedule 7 of the Terrorism Act 2000 — which is supposed to be used solely to determine whether a person is directly involved in the “commission, preparation or instigation of acts of terrorism”.

Critics have accused authorities of overusing the power, and say it is discriminatory because it disproportionately affects Muslims who travel.

According to Rabbani he had already been detained at airports as many as 20 times under the same power. And had also previously been asked for his passwords — and had not been arrested when he refused.

In this instance, after again refusing to reveal his passwords, he says he was handed a leaflet stating it is now compulsory to surrender passwords. He was then arrested, and, in May, charged with obstructing justice. A guilty verdict can result in up to three months in jail and/or a fine.

At the start of 2016, the Intercept reported that a UK appeals court had partially overturned an earlier court ruling backing Schedule 7’s powers after a legal challenge brought against it by Miranda — with the appeals court saying the statute “is not subject to adequate safeguards against its arbitrary exercise” and is “incompatible” with Article 10 of the European Convention on Human Rights, which provides the right to “receive and impart information and ideas without interference by public authority and regardless of frontiers”.

The UK government then amended a code of practice that outlines how officers should conduct searches under Schedule 7 — saying they should “cease reviewing, and not copy” information which they have grounds to believe is attorney-client privileged, is journalistic material, or is another kind of information held in confidence, which a person has “acquired or created in the course of any trade, business, profession or other occupation”.

Given that apparent change to how the law is applied, which Rabbani says he was aware of, he told the Intercept he believed there should be grounds to challenge a demand for his passwords. And he pled not guilty to the charge of obstructing justice.

In a response to the court’s verdict on Twitter today, Cage claimed the judge had been sympathetic to his argument that he was seeking to protect client confidentiality but said the current framing of the legislation left no choice but to deliver a guilty verdict.

“Our Director will consider challenging this decision and ensure the right to privacy is one that is upheld and protected,” Cage also tweeted.

“To convict under terrorism law despite not having anything to do with it is a perfect example how scaremongering is used to erode our rights. It’s precisely for this reason that CAGE will continue to call for the abolition of all counterterrorism legislation,” it added.

It’s not yet clear what sentence Rabbani is facing, though he has now confirmed to us he intends to appeal.

According to the Intercept, which cites a classified GCHQ document released to it by Snowden, UK authorities have used Schedule 7 powers to covertly download data from devices searched at borders. Downloaded data was then placed in a central database where it could be searched by GCHQ agents. Retained data could apparently include “anything stored on a target’s phone” such as contact lists, text messages, and call records.

Separately, the UK government is facing a legal challenge to counterterrorism powers which utilize bulk collection of data as an investigatory dragnet.

Earlier this month an oversight court for domestic intelligence agencies refused to rule itself on the matter — referring the issue to Europe’s top court for a verdict. The court also refused to expedite the request, meaning it will likely take several years before any judgement is passed on the legality of powers that, in the meanwhile, continue to be used by UK state agents.