Throw IncompatibleOptions error for sign --as=clearsigned --no-armor

This commit is contained in:
Paul Schaub 2023-04-09 19:53:21 +02:00
parent 6d28a7b07d
commit 17b305924c
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 11 additions and 0 deletions

View file

@ -41,6 +41,11 @@ public class InlineSignCmd extends AbstractSopCmd {
InlineSign inlineSign = throwIfUnsupportedSubcommand(
SopCLI.getSop().inlineSign(), "inline-sign");
if (!armor && type == InlineSignAs.clearsigned) {
String errorMsg = getMsg("sop.error.usage.incompatible_options.clearsigned_no_armor");
throw new SOPGPException.IncompatibleOptions(errorMsg);
}
if (type != null) {
try {
inlineSign.mode(type);