New Delhi (CNN) India's Supreme Court has voted to uphold the legality of the country's controversial Aadhaar program, the world's largest biometric database which contains the personal details of an estimated 1.2 billion Indian citizens.

In a 4:1 verdict Wednesday, the five-judge bench ruled that the scheme does not violate the right to privacy, a key element in a long running case challenging its constitutional validity.

The 1,400 page ruling, however, did introduce new restrictions on how Aadhaar information could be used, including measures preventing corporate bodies from demanding data.

Under the ruling, Aadhaar details will no longer be mandatory for opening bank accounts, obtaining mobile phone sim cards or enrolling children in schools.

The ruling will continue to permit the government to request Aadhaar information for tax reasons.

"We see it as a big victory of the Modi government," said Sambit Patra, spokesman for Prime Minister Narendra Modi's Bharatiya Janata Party (BJP).

"The Supreme Court has upheld the constitutional validity of Aadhaar, and has also said that it does not violate privacy," he added.

12-digit number

The massive centralized database was initially launched in 2009, when the now main opposition Congress party was in power, as a voluntary program to help prevent benefit fraud.

Since then, Modi and his BJP-led government have championed its growth resulting in a significant expansion in both its usage and application.

More than 90% of the entire Indian population is now registered in the identity program, which sees citizens issued with a 12-digit number that correlates with specific biometric data such as iris scans and fingerprints.

Though the system is voluntary, participation is required in order to access a range of key welfare and social services, making opting out all but impossible for most Indians.

The program in theory meant banks and government agencies could instantly verify people's identities, but it triggered concerns over the invasion of privacy and fears that Aadhaar could be used as a mass surveillance tool by the state.

Several new security measures were introduced to the database in January this year, after an alleged security breach in which an Indian journalist was able to buy access to citizens' personal details from anonymous traders for as little as $8.

Wednesday's judgment, which comes more than a year after the Supreme Court ruled that privacy was a fundamental legal right , has dismayed privacy campaigners who maintain that Aadhaar is a gross overreach of central government powers.

"Parties and governments will come and go, bad policies will remain. Aadhaar is a means of surveillance on citizens and it's a major national security risk because of the leaks that have happened," Nikhil Pahwa, co- founder of India's Internet Freedom Foundation, told CNN.

Campaigners have vowed to continue the fight to limit Aadhaar, promising to challenge the ruling by seeking further clarification from the courts.

"There is pretty much a guarantee that the judgment is just the beginning in terms of sub sequential judicial challenges and discussions, said Raman Chima, Policy Director at Access Now, an international non-profit organization that looks at tech policy. "Clarification from a larger (judicial) bench will be sought," added Chima.

The opposition Congress party, which has opposed certain aspects of the system while remaining broadly supportive of Aadhaar as a whole, welcomed the decision in a statement Wednesday.

"The Congress-led UPA's (United Progressive Alliance coalition government) vision of Aadhaar was always voluntary and never mandatory. This is an endorsement of the UPA's vision for Aadhaar and a rejection of the NDA's clumsy attempt to gather meta data on its citizens without any rationale," said the statement.

Empowering rural citizens

While Aadhaar has been criticized by activists for its broad usage and data leaks, it has also been lauded by tech leaders as the world's only system that has a billion people with the equivalent of a digital social security number and biometric ID.

Advocates maintain that Aadhaar has been responsible for granting rural residents access to vital services. India's Law Minister Ravi Shankar Prasad described Wednesday's Supreme Court ruling as "empowering democracy, good governance, service delivery and also empowering the ordinary Indian."

In recent years, Modi's government has ramped up enrollment outside of major urban areas as part of its "Digital India" program, linking registration to crucial social benefits such as a rural wage welfare program.

India's Finance Minister Arun Jaitley said he welcomed the court's ruling. "Over 100 million people are enrolled and by identifying beneficiaries of government schemes and ensuring there are no duplicate or fake beneficiaries, we are saving 900 billion rupees ($12.39 million) every year," said Jaitley of the database.

"Technology as a tool of governance, as an instrument of conferring benefits to people, as an instrument of revenue collection, I think is a concept which no one can deny and the Supreme Court, after reviewing this, has held this to be constitutionally valid."