The new law will deliver a message to tech companies to "clean up their act," the country's prime minister has said.