WELLINGTON, New Zealand (AP) — Indicted Internet entrepreneur Kim Dotcom has gone on the attack against New Zealand's foreign spy agency ahead of an eagerly anticipated showdown Wednesday with the country's prime minister.

Dotcom is the founder of the once-popular file-sharing site Megaupload, which was shut down by U.S. authorities last year. Before his arrest last year, New Zealand's Government Communications Security Bureau spied on Dotcom, an action later found by a New Zealand court to be unlawful.

In written testimony before New Zealand's Parliament, Dotcom and colleague Bram van der Kolk said they're "shocked that anyone would consider" giving the spy agency additional powers after it was found to have acted unlawfully in their case.

"The circumstances that we have endured over the past 18 months represent an extreme present day example of what can happen when government and intelligence agencies misuse or misunderstand their powers," Dotcom and van der Kolk wrote in their submission. "Anyone now can see how this can have tremendous and devastating effects on the lives and liberties of private citizens and corporations."

New Zealanders are awaiting a piece of political theater later Wednesday when Dotcom gets to elaborate on his submission at a committee chaired by Prime Minister John Key.

Parliament is considering expanding the powers of the agency, which is charged with ensuring cyber security and gathering foreign intelligence. A bill before lawmakers would allow the agency to spy on people in New Zealand in certain circumstances, something not expressly permitted under current law.

Proponents say the bill helps clarify a legal gray area while opponents say it amounts to an unwarranted intrusion into domestic affairs.

The agency's spying on Dotcom was found to be illegal because Dotcom, a German citizen by birth, was a legal resident of New Zealand at the time. Although embarrassing for the agency, the misstep to date hasn't significantly impacted the case.

U.S. prosecutors are trying to extradite Dotcom, van der Kolk and two other Megaupload executives from New Zealand, claiming they facilitated massive copyright piracy through the site. Dotcom and his colleagues deny the charges, saying they can't be held responsible for users who chose to illegally download music or movies.