> I don't really understand how it can be in any way justified in any country that's even pretending to be a democracy?
You're not misunderstanding. It really is against everything most Americans think their government is allowed to do. To your question, the 'classified' part is what you think it is: secret. 'Interpretation' is the tricky part.
Unfortunately, laws and regulations aren't exactly clear and over time situations change so one important role of the court system is interpreting how, when and whether the words in a law apply in a specific context. Courts at different levels do this all the time as cases with unique situations arise. Sometimes it's as simple as deciding if a horse counts as a vehicle in a state law which says "no vehicles on this type of road." Assuming that ruling survives appeals without being overturned, the judge will have justified the basis and, hopefully, some clear reasoning for why a horse does or doesn't count as a vehicle. That judge's ruling then becomes part of the "precedent" (aka 'body of case law') attached to that law. In effect, such precedents become part of the law since they can clarify if and how the law applies in certain situations.
So whether some action is or isn't against a law can't solely be determined by just reading the law. You have to do some interpretation, which includes looking up any relevant precedents and weighing them. A single prior ruling from one local municipal court has low weight. The main job of the Supreme Court is resolving conflicting precedents set by lower courts, so a SCOTUS ruling has a lot of weight and multiple SCOTUS rulings over time, each successively refining and narrowing (or occasionally reversing) their prior interpretations, carries maximum weight. All of this happens in the open and, in the long run, I think SCOTUS manages to eventually get most things, if not perfect, pretty close to right.
Hence, the answer to "Is this legal" can be a bit tricky when the law is new or there aren't decades of court precedents. So lawyers have to do research and assess how a court would probably rule on a given situation. That's called "a formal legal opinion" and it's provided in writing, usually including research and justifications, like references to existing case law, as well as legal reasoning supporting the opinion. Anyone can hire a lawyer to research and assess if X action violates Y law (but if you get sued for relying on the lawyer's opinion, they won't be on the hook - you will). It's called an opinion because that's really all it is.
When a govt agency wants to know if they're allowed to do X under Y law, they ask the justice dept to assess and provide a formal opinion just like any company might ask their corporate counsel to. This is often routine but can be very consequential. Where this can go horribly wrong is when these govt lawyer opinions are classified top secret. For example, we all know torturing prisoners is against U.S. law, so in the 2000s the military and CIA asked the Bush Justice Dept to provide a secret legal opinion on whether certain 'enhanced interrogation' techniques met the legal definition of torture. And they got what they wanted, a written legal opinion that waterboarding isn't torture. The Obama Justice Dept issued a secret legal opinion that droning a teenaged American citizen in Somalia, who posed no exigent threat (but had the wrong Dad), did not meet the legal definition of murder. After it happened and was no longer secret, Senator Rand Paul was the only politician willing to stand on the floor of the senate and say killing a U.S. citizen without any legal due process was first degree murder authorized by a sitting U.S. President. While it's true his Dad was sort-of a terrorist (the real terrorists were happy to use him for propaganda but being an American, they never really trusted him). The dad was arguably an enemy combatant and maybe you could make a case he was an "exigent threat", but the kid wasn't and didn't. Reasonable people can differ on acceptable levels of 'collateral damage' (aka killing foreign innocents) but U.S. law is clear, non-combatant American citizens who aren't a clear and immediate threat are a hard, bright line. They get a judge and jury, not a drone.
Senator Ron Wyden is on the Senate intelligence committee, so he gets oversight on what intelligence agencies are doing and sees the secret legal opinions they're relying on. And he's saying the U.S. govt is relying on a secret legal opinion to do something in secret which is obviously, very, VERY wrong - but he's forbidden from telling us what it is because they made it top secret. For context, Ron Wyden has been a Senator and on the intelligence committee for a while and is pretty much a straight-shooter, not known for hyperbole or politically-motivated grandstanding. He'll call out his own party when he feels they're seriously wrong and he gets no benefit from making a big deal over this. His own party isn't supporting him and wishes he'd shut up about it. Yet for the last six months he's been signaling "DANGER, DANGER" in interviews, speeches and in writing over and over again - so I'm going to assume whatever it is is way beyond the Snowden revelations and probably in the neighborhood of the worst things we can possibly imagine.
The perverse thing is that the pretense for keeping it secret is to prevent 'foreign adversary governments' from knowing what it is, but it's clearly about domestic spying on U.S. citizens - and Russia and China probably already know exactly what it is (and are like, "Hmph amateurs, we've been doing that to our citizens years").
You're not misunderstanding. It really is against everything most Americans think their government is allowed to do. To your question, the 'classified' part is what you think it is: secret. 'Interpretation' is the tricky part.
Unfortunately, laws and regulations aren't exactly clear and over time situations change so one important role of the court system is interpreting how, when and whether the words in a law apply in a specific context. Courts at different levels do this all the time as cases with unique situations arise. Sometimes it's as simple as deciding if a horse counts as a vehicle in a state law which says "no vehicles on this type of road." Assuming that ruling survives appeals without being overturned, the judge will have justified the basis and, hopefully, some clear reasoning for why a horse does or doesn't count as a vehicle. That judge's ruling then becomes part of the "precedent" (aka 'body of case law') attached to that law. In effect, such precedents become part of the law since they can clarify if and how the law applies in certain situations.
So whether some action is or isn't against a law can't solely be determined by just reading the law. You have to do some interpretation, which includes looking up any relevant precedents and weighing them. A single prior ruling from one local municipal court has low weight. The main job of the Supreme Court is resolving conflicting precedents set by lower courts, so a SCOTUS ruling has a lot of weight and multiple SCOTUS rulings over time, each successively refining and narrowing (or occasionally reversing) their prior interpretations, carries maximum weight. All of this happens in the open and, in the long run, I think SCOTUS manages to eventually get most things, if not perfect, pretty close to right.
Hence, the answer to "Is this legal" can be a bit tricky when the law is new or there aren't decades of court precedents. So lawyers have to do research and assess how a court would probably rule on a given situation. That's called "a formal legal opinion" and it's provided in writing, usually including research and justifications, like references to existing case law, as well as legal reasoning supporting the opinion. Anyone can hire a lawyer to research and assess if X action violates Y law (but if you get sued for relying on the lawyer's opinion, they won't be on the hook - you will). It's called an opinion because that's really all it is.
When a govt agency wants to know if they're allowed to do X under Y law, they ask the justice dept to assess and provide a formal opinion just like any company might ask their corporate counsel to. This is often routine but can be very consequential. Where this can go horribly wrong is when these govt lawyer opinions are classified top secret. For example, we all know torturing prisoners is against U.S. law, so in the 2000s the military and CIA asked the Bush Justice Dept to provide a secret legal opinion on whether certain 'enhanced interrogation' techniques met the legal definition of torture. And they got what they wanted, a written legal opinion that waterboarding isn't torture. The Obama Justice Dept issued a secret legal opinion that droning a teenaged American citizen in Somalia, who posed no exigent threat (but had the wrong Dad), did not meet the legal definition of murder. After it happened and was no longer secret, Senator Rand Paul was the only politician willing to stand on the floor of the senate and say killing a U.S. citizen without any legal due process was first degree murder authorized by a sitting U.S. President. While it's true his Dad was sort-of a terrorist (the real terrorists were happy to use him for propaganda but being an American, they never really trusted him). The dad was arguably an enemy combatant and maybe you could make a case he was an "exigent threat", but the kid wasn't and didn't. Reasonable people can differ on acceptable levels of 'collateral damage' (aka killing foreign innocents) but U.S. law is clear, non-combatant American citizens who aren't a clear and immediate threat are a hard, bright line. They get a judge and jury, not a drone.
Senator Ron Wyden is on the Senate intelligence committee, so he gets oversight on what intelligence agencies are doing and sees the secret legal opinions they're relying on. And he's saying the U.S. govt is relying on a secret legal opinion to do something in secret which is obviously, very, VERY wrong - but he's forbidden from telling us what it is because they made it top secret. For context, Ron Wyden has been a Senator and on the intelligence committee for a while and is pretty much a straight-shooter, not known for hyperbole or politically-motivated grandstanding. He'll call out his own party when he feels they're seriously wrong and he gets no benefit from making a big deal over this. His own party isn't supporting him and wishes he'd shut up about it. Yet for the last six months he's been signaling "DANGER, DANGER" in interviews, speeches and in writing over and over again - so I'm going to assume whatever it is is way beyond the Snowden revelations and probably in the neighborhood of the worst things we can possibly imagine.
The perverse thing is that the pretense for keeping it secret is to prevent 'foreign adversary governments' from knowing what it is, but it's clearly about domestic spying on U.S. citizens - and Russia and China probably already know exactly what it is (and are like, "Hmph amateurs, we've been doing that to our citizens years").