Allow storing db.user and db.pass in environment variables
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / utils / PasswordProcessor.java
index f87a9b9..a6a3e2b 100644 (file)
@@ -6,16 +6,16 @@
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
  * You may obtain a copy of the License at\r
- * <p>\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- * <p>\r
- * Unless required by applicable law or agreed to in writing, software\r
+ *\r
+ * <p>http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * <p>* Unless required by applicable law or agreed to in writing, software\r
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
  * See the License for the specific language governing permissions and\r
  * limitations under the License.\r
- * <p>\r
- * SPDX-License-Identifier: Apache-2.0\r
+ *\r
+ * <p>* SPDX-License-Identifier: Apache-2.0\r
  * ============LICENSE_END=========================================================\r
  */\r
 \r
@@ -30,6 +30,7 @@ import javax.crypto.SecretKey;
 import javax.crypto.SecretKeyFactory;\r
 import javax.crypto.spec.PBEKeySpec;\r
 import javax.crypto.spec.PBEParameterSpec;\r
+import org.onap.dmaap.datarouter.provisioning.ProvRunner;\r
 \r
 /**\r
  * The Processing of a Password.  Password can be encrypted and decrypted.\r
@@ -40,7 +41,7 @@ public class PasswordProcessor {
 \r
     private static final String SECRET_KEY_FACTORY_TYPE = "PBEWithMD5AndDES";\r
     private static final String PASSWORD_ENCRYPTION_STRING =\r
-            (new DB()).getProperties().getProperty("org.onap.dmaap.datarouter.provserver.passwordencryption");\r
+            ProvRunner.getProvProperties().getProperty("org.onap.dmaap.datarouter.provserver.passwordencryption");\r
     private static final char[] PASSWORD = PASSWORD_ENCRYPTION_STRING.toCharArray();\r
     private static final byte[] SALT = {(byte) 0xde, (byte) 0x33, (byte) 0x10,\r
         (byte) 0x12, (byte) 0xde, (byte) 0x33, (byte) 0x10, (byte) 0x12,};\r