diff options
Diffstat (limited to 'security-util-lib/src/main/java/org/onap')
-rw-r--r-- | security-util-lib/src/main/java/org/onap/sdc/security/SecurityUtil.java | 5 | ||||
-rw-r--r-- | security-util-lib/src/main/java/org/onap/sdc/security/utils/RestUtils.java | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/security-util-lib/src/main/java/org/onap/sdc/security/SecurityUtil.java b/security-util-lib/src/main/java/org/onap/sdc/security/SecurityUtil.java index eb67813..099ca0a 100644 --- a/security-util-lib/src/main/java/org/onap/sdc/security/SecurityUtil.java +++ b/security-util-lib/src/main/java/org/onap/sdc/security/SecurityUtil.java @@ -46,7 +46,6 @@ public class SecurityUtil { private static final Logger LOG = Logger.getLogger(SecurityUtil.class); - public static final SecurityUtil INSTANCE = new SecurityUtil(); public static final String ALGORITHM = "AES"; public static final String CHARSET = UTF_8.name(); @@ -69,7 +68,7 @@ public class SecurityUtil { } // obfuscates key prefix -> ********** - public String obfuscateKey(String sensitiveData) { + public static String obfuscateKey(String sensitiveData) { if (sensitiveData == null) { return null; @@ -176,7 +175,7 @@ public class SecurityUtil { return Either.right("Decrypt FAILED"); } - public Either<String, String> decrypt(String byteCipherText) { + public static Either<String, String> decrypt(String byteCipherText) { try { return decrypt(byteCipherText.getBytes(CHARSET), true); } catch (UnsupportedEncodingException e) { diff --git a/security-util-lib/src/main/java/org/onap/sdc/security/utils/RestUtils.java b/security-util-lib/src/main/java/org/onap/sdc/security/utils/RestUtils.java index 2803720..5df9d8a 100644 --- a/security-util-lib/src/main/java/org/onap/sdc/security/utils/RestUtils.java +++ b/security-util-lib/src/main/java/org/onap/sdc/security/utils/RestUtils.java @@ -32,6 +32,8 @@ import java.util.Properties; public class RestUtils { + private RestUtils() {} + public static void addBasicAuthHeader(Properties headers, String username, String password) { headers.setProperty(HttpHeaders.AUTHORIZATION, getAuthHeaderValue(username,password)); } @@ -49,7 +51,7 @@ public class RestUtils { @VisibleForTesting public static String decryptPassword(String password) { validate(password); - Either<String, String> passkey = SecurityUtil.INSTANCE.decrypt(password); + Either<String, String> passkey = SecurityUtil.decrypt(password); if(passkey.isLeft()) { return passkey.left().value(); } |