The encrypted messaging app Telegram continues to have a tough time in Russia. Having previously been threatened with blockage for not providing operational information, Telegram has now been hit with a significant fine – and ordered to hand over the encryption keys that led to the fine in the first place.

Early on Monday, a court in Moscow’s Meshchansky district ordered Telegram to pay a fine of 800,000 rubles (around $14,000) for refusing to give the FSB state security agency the keys to decrypt users’ correspondence. The so-called Yarovaya law – a package of anti-terrorism measures that was passed last year – requires the providers of messaging services to give the FSB access to users’ encrypted communications.

According to an Interfax report, the FSB asked Telegram in July for information about six phone numbers, but Telegram did not respond.

Telegram chief Pavel Durov, who is also well-known as the founder of the popular Russian social network VK, insists that the Yarovaya law is itself not legally valid. In a Monday post on VK, Durov said the FSB’s requirements are at odds with Article 23 of the Russian Federation’s constitution, which promises people that they have the right to privacy of correspondence and other communications.

Durov said Telegram will appeal the ruling “until the FSB lawsuit is heard by a judge familiar with the basic law of Russia.” He also requested that lawyers who might want to take on the case should get in touch, as he will put together a legal team in the next couple of days to fight the case.

So what happened with that operational information that could have led to Telegram’s blockage? In that case, Durov backed down and agreed to register Telegram with Russian censors – though he refused to comply with demands to retain records of user data.

As Durov pointed out at the time, the blockage of Telegram in Russia would simply have meant that its 10 million users in the country would have to send their secret correspondence through U.S.-based channels such as WhatsApp, or through the Israeli Viber. Telegram is apparently popular with some senior Russian officials, such as Kremlin spokesman Dmitry Peskov.

Russia isn’t the only country that has a beef with Durov. The authorities in Iran filed a lawsuit against him late last month on the basis that Telegram was a “platform for the activities of organized criminal groups” ranging from ISIS to child pornographers and traffickers of drugs and people.

Telegram is widely used in Iran – by 40 million people, Durov has claimed – and was reportedly instrumental in the organization of support for the election of the relatively moderate president Hassan Rouhani. However, the hardline judiciary is very keen to block it.

Last month Durov said that being denied entry into Russia occasionally would be “more painful” for him than his inability to visit Iran, primarily because it would affect his ability to visit his parents.

Durov left Russia in 2014 after VK was gradually taken over by Kremlin-linked oligarchs and investment funds. He went on to found Telegram in Berlin with his brother Nikolai.