mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 12:57:57 +01:00
Add support for --with-key-password to Sign
This commit is contained in:
parent
8406793d0e
commit
55aefb799f
1 changed files with 8 additions and 0 deletions
|
@ -40,6 +40,10 @@ public class SignCmd implements Runnable {
|
|||
paramLabel = "KEYS")
|
||||
List<File> secretKeyFile = new ArrayList<>();
|
||||
|
||||
@CommandLine.Option(names = "--with-key-password", description = "Password(s) to unlock the secret key(s) with",
|
||||
paramLabel = "PASSWORD")
|
||||
List<String> withKeyPassword = new ArrayList<>();
|
||||
|
||||
@CommandLine.Option(names = "--micalg-out", description = "Emits the digest algorithm used to the specified file in a way that can be used to populate the micalg parameter for the PGP/MIME Content-Type (RFC3156)",
|
||||
paramLabel = "MICALG")
|
||||
File micAlgOut;
|
||||
|
@ -70,6 +74,10 @@ public class SignCmd implements Runnable {
|
|||
System.exit(19);
|
||||
}
|
||||
|
||||
for (String password : withKeyPassword) {
|
||||
sign.withKeyPassword(password);
|
||||
}
|
||||
|
||||
for (File keyFile : secretKeyFile) {
|
||||
try (FileInputStream keyIn = new FileInputStream(keyFile)) {
|
||||
sign.key(keyIn);
|
||||
|
|
Loading…
Reference in a new issue