Dean Baquet, the top editor at the New York Times, said he'd publish a story on Donald Trump's taxes even if it means risking jail time.

He made the remark during a Harvard University forum Sunday, when he was asked about the legal risks tied to publishing a leaked or hacked copy of Trump's taxes.

"I think every journalist on the planet wants Donald Trump's tax returns," said Laura Poitras, a filmmaker who made an Academy Award-winning documentary about NSA leaker Edward Snowden.

Related: Why Trump owes it to voters to release his tax returns

But she told both Baquet and Washington Post Associate Editor Bob Woodward, who was also there, that the lawyers for their newspapers would probably warn them that they'd face jail time for publishing such information.

"If the Post or the Times were to get Donald Trump's tax returns, would you publish them?" she asked.

Both said yes, that they'd argue with the attorneys to do so.

Baquet said Trump's taxes are important because he is "a presidential candidate whose whole campaign is built on his success as a business man, and his wealth," and that his taxes could cast light on whether that's true.

Woodward joked that if a judge handed down a five-year jail sentence to the Post for publishing the taxes, he'd have everyone at the paper serve a single day of the sentence. But he also stressed that it's very important to report on the taxes.

"Some things you have to do. Dean is exactly right. This defines Donald Trump," Woodward said.