My understanding is that anything is legal as long as it stays aboard a ship, if it's legal at all. The catch is that there's always the risk that meddling authorities will be concerned about the possibility that they will leave the ship.
"Yes, captain, there's no law that says you can't keep a plasma gun in your ship's locker. But you can understand that planetary authorities might be concerned about a weapon that could cripple your entire ship if fired aboard. I'm afraid we'll have to lock it up in a tamper-guard box until your ship leaves atmosphere. May I have a moment to look up the cost of that size of tamper-guard box? It's not a size we use every day."
Even nuclear weapons are legal, as long as they are never used within a planetary atmosphere or near civilian structures in vacuum. But the risk that someone might violate that rule -- the regulation most likely to draw prompt attention of a large force of Imperial Marines -- means that not just anyone will be permitted to possess them, even if the warhead includes a fairly strong failsafe to limit where it can be detonated.
"I'm sorry, captain, but we can't allow you to take your ship to the downport, even with your anti-piracy nuclear license. Taking a nuke planetside requires an Imperial Marine nuclear weapons team or 'equivalent security measures', and if I understand the equivalency formula correctly we don't have enough security personnel in the entire downport, and probably couldn't round it up without deputizing most of the startown police force too.
"Here at the highport, we're supposed to have the equivalent of an Imperial Navy warhead transport watch, but since we're way out here on the Hazard Spar dock, I can reduce that to a pair of guards each by your warhead locker, your missile turret, and your fire control. That will cost 100 per day, each, but I'll pro-rate it to quarter days as long as you're off-structure before I have to start paying them overtime.
"And by the way, I know you probably can't tell me how you qualified for that license, but whatever it was I should probably say, thank you for your service to the Imperium."