At some point the government can not allow the press to expose secrets to our enemies. I'm not sure what could be done seeing how we have a free press. But what are the limits? Could the NYT publish the nuclear launch codes and get away with it?
Could they get away with it? We'd hang them. But I think they would try, yes. Two reminders for the NYT: Ethel and Julius. They better keep history in mind.
Brief history of the Espionage Act (18 USC 793, et seq) ...
http://www.spartacus.schoolnet.co.uk/FWWespionage.htm
Publisher of an anti-draft pamphlet was jailed, and the conviction was upheld in Schenck v. United States, 249 U.S. 47 (1919).
Rosenberg isn't a good example for this case. They were accused, convicted and sentenced for passing information surreptitiously. Hansen would be a more apt corrolary to Rosenberg.
Ellsberg and The Pentagon Papers is a decent starting point too.