SAN FRANCISCO — The prosecution and the defense are sparring fiercely over whether Walter Liew should be punished as a cunning spy or as an honest man who misjudged the line between the public domain and trade secrets.

At a sentencing hearing next Tuesday, U.S. District Judge Jeffrey White is expected to decide how long Liew, who allegedly stole trade secrets from DuPont Co. and sold them to China, should spend behind bars. After a nearly two-month trial, a San Francisco federal jury in March convicted the 56-year-old East Bay man of conspiracy to commit economic espionage, trade secret theft, filing false tax returns and witness and evidence tampering, among other charges.