diff --git a/activemq-console/pom.xml b/activemq-console/pom.xml
index ded9dabe09..e43fdab635 100644
--- a/activemq-console/pom.xml
+++ b/activemq-console/pom.xml
@@ -118,6 +118,14 @@
net.sf.josqlgentlyweb-utils
+
+ org.jasypt
+ jasypt
+
+
+ com.ibm.icu
+ icu4j
+
diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/DecryptCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/DecryptCommand.java
new file mode 100644
index 0000000000..2bff397825
--- /dev/null
+++ b/activemq-console/src/main/java/org/apache/activemq/console/command/DecryptCommand.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.console.command;
+
+import java.util.List;
+
+import org.jasypt.exceptions.EncryptionOperationNotPossibleException;
+
+public class DecryptCommand extends EncryptCommand {
+
+ protected String[] helpFile = new String[] {
+ "Task Usage: Main decrypt --password --input ",
+ "Description: Decrypts given text.",
+ "",
+ "Encrypt Options:",
+ " --password Password to be used by the encryptor.",
+ " --input Text to be encrypted.",
+ " --version Display the version information.",
+ " -h,-?,--help Display the stop broker help information.",
+ ""
+ };
+
+ @Override
+ protected void runTask(List tokens) throws Exception {
+ if (password == null || input == null) {
+ context.printException(new IllegalArgumentException("input and password parameters are mandatory"));
+ return;
+ }
+ encryptor.setPassword(password);
+ try {
+ context.print("Decrypted text: " + encryptor.decrypt(input));
+ } catch (EncryptionOperationNotPossibleException e) {
+ context.print("ERROR: Text cannot be decrypted, check your input and password and try again!");
+ }
+ }
+
+
+
+}
diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/EncryptCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/EncryptCommand.java
new file mode 100644
index 0000000000..d3d81fd18c
--- /dev/null
+++ b/activemq-console/src/main/java/org/apache/activemq/console/command/EncryptCommand.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.console.command;
+
+import java.util.List;
+
+import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
+
+public class EncryptCommand extends AbstractCommand {
+
+ protected String[] helpFile = new String[] {
+ "Task Usage: Main encrypt --password --input ",
+ "Description: Encrypts given text.",
+ "",
+ "Encrypt Options:",
+ " --password Password to be used by the encryptor.",
+ " --input Text to be encrypted.",
+ " --version Display the version information.",
+ " -h,-?,--help Display the stop broker help information.",
+ ""
+ };
+
+ StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
+ String input;
+ String password;
+
+ @Override
+ protected void printHelp() {
+ context.printHelp(helpFile);
+ }
+
+ @Override
+ protected void runTask(List tokens) throws Exception {
+ if (password == null || input == null) {
+ context.printException(new IllegalArgumentException("input and password parameters are mandatory"));
+ return;
+ }
+ encryptor.setPassword(password);
+ context.print("Encrypted text: " + encryptor.encrypt(input));
+ }
+
+ @Override
+ protected void handleOption(String token, List tokens) throws Exception {
+ if (token.startsWith("--input")) {
+ if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) {
+ context.printException(new IllegalArgumentException("input not specified"));
+ return;
+ }
+
+ input=(String)tokens.remove(0);
+ } else if (token.startsWith("--password")) {
+ if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) {
+ context.printException(new IllegalArgumentException("password not specified"));
+ return;
+ }
+
+ password=(String)tokens.remove(0);
+ } else {
+ super.handleOption(token, tokens);
+ }
+ }
+
+
+
+}
diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java
index d760ceebfc..c4a15d1dc4 100644
--- a/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java
+++ b/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java
@@ -49,6 +49,8 @@ public class ShellCommand extends AbstractCommand {
" browse - Display selected messages in a specified destination.",
" journal-audit - Allows you to view records stored in the persistent journal.",
" purge - Delete selected destination's messages that matches the message selector",
+ " encrypt - Encrypts given text",
+ " decrypt - Decrypts given text",
"",
"Task Options (Options specific to each task):",
" --extdir - Add the jar files in the directory to the classpath.",
@@ -126,6 +128,10 @@ public class ShellCommand extends AbstractCommand {
command = new PurgeCommand();
} else if (taskToken.equals("journal-audit")) {
command = new AMQJournalToolCommand();
+ } else if (taskToken.equals("encrypt")) {
+ command = new EncryptCommand();
+ } else if (taskToken.equals("decrypt")) {
+ command = new DecryptCommand();
} else if (taskToken.equals("help")) {
printHelp();
} else {
diff --git a/activemq-core/pom.xml b/activemq-core/pom.xml
index 8816a6bf28..c435825d5c 100755
--- a/activemq-core/pom.xml
+++ b/activemq-core/pom.xml
@@ -138,7 +138,7 @@
org.codehaus.jettisonjettisontrue
-
+
@@ -229,6 +229,15 @@
activemq-jmdns_1.0true
+
+
+ org.jasypt
+ jasypt
+
+
+ com.ibm.icu
+ icu4j
+
diff --git a/activemq-core/src/test/resources/credentials.properties b/activemq-core/src/test/resources/credentials.properties
new file mode 100644
index 0000000000..86f719940f
--- /dev/null
+++ b/activemq-core/src/test/resources/credentials.properties
@@ -0,0 +1,24 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+# Defines credentials that will be used by components (like web console) to access the broker
+
+activemq.username=system
+#activemq.password=manager
+activemq.password=ENC(mYRkg+4Q4hua1kvpCCI2hg==)
+#guest.password=password
+guest.password=ENC(Cf3Jf3tM+UrSOoaKU50od5CuBa8rxjoL)
\ No newline at end of file
diff --git a/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml b/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml
index 0b1f3aa032..e525ee39d1 100644
--- a/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml
+++ b/activemq-core/src/test/resources/org/apache/activemq/security/simple-auth-broker.xml
@@ -25,7 +25,15 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
-
+
+
+
+
+
+
+
+
+
@@ -41,11 +49,11 @@
-
-
-
+
diff --git a/assembly/pom.xml b/assembly/pom.xml
index c531a5de99..fc97f46e25 100755
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -318,7 +318,14 @@
staxstax
-
+
+ org.jasypt
+ jasypt
+
+
+ com.ibm.icu
+ icu4j
+ junit
diff --git a/assembly/src/main/descriptors/common-bin.xml b/assembly/src/main/descriptors/common-bin.xml
index acc849b05a..1bb5ec001b 100644
--- a/assembly/src/main/descriptors/common-bin.xml
+++ b/assembly/src/main/descriptors/common-bin.xml
@@ -210,6 +210,8 @@
org.codehaus.jettison:jettisonorg.apache.velocity:velocitynet.sf.josql:josql
+ org.jasypt:jasypt
+ com.ibm.icu:icu4j
diff --git a/assembly/src/release/conf/activemq.xml b/assembly/src/release/conf/activemq.xml
index cbcde811de..3156e1a93e 100755
--- a/assembly/src/release/conf/activemq.xml
+++ b/assembly/src/release/conf/activemq.xml
@@ -21,12 +21,16 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
-
-
-
- file:${activemq.base}/conf/credentials.properties
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml b/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml
index d242f8926c..f075fb6f1a 100644
--- a/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml
+++ b/assembly/src/release/webapps/camel/WEB-INF/applicationContext.xml
@@ -25,11 +25,16 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
-
-
- file:${activemq.base}/conf/credentials.properties
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/assembly/src/sample-conf/activemq-security.xml b/assembly/src/sample-conf/activemq-security.xml
index 9bf1309410..8f8939b5d8 100644
--- a/assembly/src/sample-conf/activemq-security.xml
+++ b/assembly/src/sample-conf/activemq-security.xml
@@ -32,11 +32,16 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
-
-
- file:${activemq.base}/conf/credentials.properties
-
-
+
+
+
+
+
+
+
+
+
+
@@ -44,11 +49,11 @@
-
-
-
+
diff --git a/pom.xml b/pom.xml
index 029a4867db..83666b644f 100755
--- a/pom.xml
+++ b/pom.xml
@@ -61,6 +61,8 @@
1.00.1.81.7.2.2
+ 4.0.1
+ 1.61.07.0.1.v200911252.1.v20100127
@@ -821,6 +823,18 @@
aopalliance${aopalliance-version}
+
+
+ org.jasypt
+ jasypt
+ ${jasypt-version}
+
+
+
+ com.ibm.icu
+ icu4j
+ ${icu-version}
+