aboutsummaryrefslogtreecommitdiffstats
path: root/cmso-optimizer/src
diff options
context:
space:
mode:
Diffstat (limited to 'cmso-optimizer/src')
-rw-r--r--cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/common/PropertiesManagement.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/common/PropertiesManagement.java b/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/common/PropertiesManagement.java
index 4b68176..12da757 100644
--- a/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/common/PropertiesManagement.java
+++ b/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/common/PropertiesManagement.java
@@ -28,10 +28,10 @@ package org.onap.optf.cmso.optimizer.common;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
+import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
-import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -104,7 +104,7 @@ public class PropertiesManagement {
Cipher cipher = Cipher.getInstance(transformation);
cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
byte[] encrypted = cipher.doFinal(value.getBytes());
- return Base64.encodeBase64String(encrypted);
+ return Base64.getEncoder().encodeToString(encrypted);
} catch (Exception ex) {
errors.error("Unexpected exception {0}", ex.getMessage());
debug.debug("Unexpected exception", ex);
@@ -119,7 +119,7 @@ public class PropertiesManagement {
SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
Cipher cipher = Cipher.getInstance(transformation);
cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
- byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
+ byte[] original = cipher.doFinal(Base64.getDecoder().decode(encrypted));
return new String(original);
} catch (Exception ex) {
errors.error("Unexpected exception {0}", ex.getMessage());