Earth was being attacked, no one had a clue what was going on, so yeah - Nero got the codes. Not that Earth has ever been shown to have much in the way of defences, although they were spoken of in TMP.
"Frequencies please, sir." is one of my favourite lines from the movie. He's gonna keeeeel
poor Christopher if he has to.
As for the supernova/black hole thing, it did
work in the movie. Not so sure it'd work as a real-life solution to such a problem, though... not so sure such a problem is likely to come up, though. IRL a distant supernova would kill us with radiation, not a wall of fire.