aboutsummaryrefslogtreecommitdiffstats
path: root/cmso-service/src
diff options
context:
space:
mode:
authorJerry Flood <jflood@att.com>2019-04-24 16:10:56 -0400
committerJerry Flood <jflood@att.com>2019-04-24 16:11:24 -0400
commitd4014abb85d839c14c9a2572098571e7a8523104 (patch)
tree4e7a2c855d04b2ee5226fff254bf005031ca3e47 /cmso-service/src
parent94796d7bc341691cdeac3010012fe3d1c42228bc (diff)
Remove dependency on commons-codec
Issue-ID: OPTFRA-479 Change-Id: Id8873f7df5011fa36465a36b2d39d637869d1426 Signed-off-by: Jerry Flood <jflood@att.com>
Diffstat (limited to 'cmso-service/src')
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
index de917e4..b16c52a 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
@@ -33,10 +33,10 @@ package org.onap.optf.cmso.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;
@@ -105,7 +105,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);
@@ -120,7 +120,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());