Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#345: Improve Jasypt ToolCommandlet #358

Merged
merged 9 commits into from
Jun 18, 2024
Next Next commit
first implementation
mvomiero committed May 22, 2024
commit 80241645136647c6ca2279af8d8e2b6f42244be6
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@
import java.util.Set;

/**
* {@link ToolCommandlet} for <a href="http://www.jasypt.org/">Jasypt</a>, The java library which allows to add basic
* encryption capabilities with minimum effort.
* {@link ToolCommandlet} for <a href="http://www.jasypt.org/">Jasypt</a>, The java library which allows to add basic encryption capabilities with minimum
* effort.
*/
public class Jasypt extends LocalToolCommandlet {

@@ -90,8 +90,8 @@ private void runJasypt(String className) {
String algorithm = jasyptOptions[0];
String generatorClassName = jasyptOptions[1];

java.runTool(null, "-cp", resolveJasyptJarPath().toString(), className, algorithm, generatorClassName,
"password=" + this.masterPassword.getValue(), "input=" + this.secret.getValue());
java.runTool(null, "-cp", resolveJasyptJarPath().toString(), className, "password=" + this.masterPassword.getValue(), "input=" + this.secret.getValue(),
algorithm, generatorClassName);
}

private Path resolveJasyptJarPath() {
5 changes: 3 additions & 2 deletions cli/src/main/resources/nls/Help.properties
Original file line number Diff line number Diff line change
@@ -20,8 +20,9 @@ cmd.helm=Tool commandlet for Helm (Kubernetes Package Manager).
cmd.help=Prints this help.
cmd.install=Install the selected tool.
cmd.intellij=Tool commandlet for IntelliJ (IDE)
cmd.jasypt=Tool commandlet for Jasypt (encryption/decryption).
cmd.jasypt.val.command=Modues (encrypt | decrypt)
cmd.jasypt=Tool commandlet for Jasypt, allowing you to install Jasypt and encrypt or decrypt secrets using strong encryption with a secure master password. \
You can input custom arguments by setting the JASYPT_OPTS variable, which defaults to JASYPT_OPTS="algorithm=PBEWITHHMACSHA512ANDAES_256 ivGeneratorClassName=org.jasypt.iv.RandomIvGenerator".
cmd.jasypt.val.command=Action (encrypt | decrypt)
cmd.jasypt.val.masterPassword=master password.
cmd.jasypt.val.secret=The secret to be encrypted or decrypted.
cmd.java=Tool commandlet for Java (OpenJDK).