2020-11-26 11:00:48 +01:00
|
|
|
package org.pgpainless.sop;
|
|
|
|
|
2020-12-16 17:31:27 +01:00
|
|
|
import org.pgpainless.sop.commands.*;
|
2020-11-26 11:00:48 +01:00
|
|
|
import picocli.CommandLine;
|
|
|
|
|
|
|
|
@CommandLine.Command(
|
|
|
|
subcommands = {
|
|
|
|
Version.class,
|
|
|
|
GenerateKey.class,
|
|
|
|
ExtractCert.class,
|
2020-12-16 17:31:27 +01:00
|
|
|
Sign.class,
|
|
|
|
Verify.class
|
2020-11-26 11:00:48 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
public class PGPainlessCLI implements Runnable {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
interpret(args);
|
|
|
|
// generateKey();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void interpret(String... args) {
|
|
|
|
CommandLine.run(new PGPainlessCLI(), args);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void version() {
|
|
|
|
CommandLine.run(new PGPainlessCLI(), "version");
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void generateKey() {
|
|
|
|
interpret("generate-key", "--armor", "Alice Example <alice@wonderland.lit>");
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void extractCert() {
|
|
|
|
CommandLine.run(new PGPainlessCLI(), "extract-cert");
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void sign() {
|
|
|
|
interpret("sign", "--armor", "--as=text", "alice.sec");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|