You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by fm...@apache.org on 2023/12/13 13:27:29 UTC

(camel) 02/02: Update jasypt docs

This is an automated email from the ASF dual-hosted git repository.

fmariani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9d66b01c1c3f94cccbaaca123af543c4cc378d2b
Author: Croway <fe...@gmail.com>
AuthorDate: Wed Dec 13 13:44:25 2023 +0100

    Update jasypt docs
---
 components/camel-jasypt/src/main/docs/jasypt.adoc        | 16 ++++++++++++++++
 .../java/org/apache/camel/component/jasypt/Main.java     |  6 ------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/components/camel-jasypt/src/main/docs/jasypt.adoc b/components/camel-jasypt/src/main/docs/jasypt.adoc
index 508c57f47c6..bb51a37dfe9 100644
--- a/components/camel-jasypt/src/main/docs/jasypt.adoc
+++ b/components/camel-jasypt/src/main/docs/jasypt.adoc
@@ -62,6 +62,8 @@ Apache Camel Jasypt takes the following options
   -p or -password <password> = Password to use
   -i or -input <input> = Text to encrypt or decrypt
   -a or -algorithm <algorithm> = Optional algorithm to use
+  -rsga or -algorithm <algorithm> = Optional random salt generator algorithm to use
+  -riga or -algorithm <algorithm> = Optional random iv generator algorithm to use
 --------------------------------------------------------------
 
 For example to encrypt the value `tiger` you run with the following
@@ -171,6 +173,20 @@ The properties file `myproperties.properties` then contain the encrypted
 value, such as shown below. Notice how the password value is encrypted
 and the value has the tokens surrounding `ENC(value here)`
 
+[TIP]
+====
+It is possible to configure custom algorithms on the JasyptPropertiesParser like this
+
+[source,java]
+-----------------------------------------------------------------------------------------------------------
+JasyptPropertiesParser jasyptPropertiesParser = new JasyptPropertiesParser();
+
+jasyptPropertiesParser.setAlgorithm("PBEWithHmacSHA256AndAES_256");
+jasyptPropertiesParser.setRandomSaltGeneratorAlgorithm("PKCS11");
+jasyptPropertiesParser.setRandomIvGeneratorAlgorithm("PKCS11");
+-----------------------------------------------------------------------------------------------------------
+====
+
 == Example with Spring XML
 
 In Spring XML you need to configure the `JasyptPropertiesParser` which
diff --git a/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/Main.java b/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/Main.java
index 15a89d414ac..14c8a07a41f 100644
--- a/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/Main.java
+++ b/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/Main.java
@@ -150,12 +150,6 @@ public class Main {
                 randomIvGeneratorAlgorithm = parameter;
             }
         });
-
-        addOption(new ParameterOption("a", "algorithm", "Optional algorithm to use", "algorithm") {
-            protected void doProcess(String arg, String parameter, LinkedList<String> remainingArgs) {
-                algorithm = parameter;
-            }
-        });
     }
 
     private void addOption(Option option) {