Casual sex and gay sex in Indonesia could become illegal.

Conservative groups have asked the nation's constitutional court to crack down on so-called immoral behaviour — like sex outside marriage and gay sex — and have said the nation's criminal code that allows this should be struck down.

Lawyer Fiezal Syahmenan — who is representing conservative religious group The Family Love Alliance — said the case was about nationalism, not sex.

"These laws were created by the Dutch colonial government which are not based on Indonesian values, or Indonesia's constitution," Mr Syahmenan said.

The Family Love Alliance is the plaintiff in the case.

If the group gets what it wants, those most likely to actually be prosecuted will be members of Indonesia's gay community — always referred to in Indonesia as LGBT.

When they have sex, they will be breaking the law.

"Just like I don't care if people choose to be Islam or Christian, that is their own business," Mr Syahmenan said.

"But the point is that LGBT is not in line with the values in the foundation of this country, that is the problem."

'Bleak time' for LGBTI community

The past 12 months have been terrible for Indonesia's LGBT community.

Gay rights advocate Dede Oetomo feels society has become more conservative. ( ABC News: Adam Harvey )

A gay support group was hounded off a university campus. A former cabinet minister said gays should be killed. The nation's deputy president cut funding to a program designed to end stigma. And the nation's peak psychiatric body said homosexuality was a condition that could be cured.

Veteran gay rights advocate Dede Oetomo said it was a bleak time in Indonesia.

"Society has become more … categorically conservative," he said.

"I have a feeling the religionists are free to propagate homophobia, transphobia."

Mr Oetomo said the court case and new laws being considered by Parliament were the most serious attacks yet on the community.

"You cannot criminalise being gay," he said.

"But [criminalising] gay sex, yeah. It's already there in Aceh, and South Sumatra and six other districts or municipalities.

"It's spreading. If Parliament passes the articles on sexuality, we're illegal. All casual sex illegal."

Even married couples could be vulnerable

Some conservative areas already have local codes that criminalise so-called immoral behaviour.

Under Aceh's sharia law, for instance, you can be caned if you are caught alone in a room with someone of the opposite sex.

Earlier this year, the ABC witnessed a teenage girl being caned for so-called "lustful conduct" after she was convicted of being alone with her boyfriend.

But the laws under scrutiny at the Constitutional Court will apply to all 250 million Indonesians.

The Family Love Alliance's stance is being opposed by human rights groups like the National Commission on Violence Against Women.

The commission's Azriana told the Constitutional Court sweeping laws like this were very dangerous.

"When the state goes too far, and enters the personal space, what happens is that ordinary people will be criminalised," she said.

"Those who are married but don't hold a state marital document, say if they're married based on indigenous law, then police can come to their bedroom and grab them, as they don't have legal evidence to verify their marriage.

"A gay couple or even a husband and wife, they are vulnerable to being accused of doing adultery."