summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-11-07 17:58:12 +0100
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-11-07 17:58:12 +0100
commit73f5f8ba2480fc8d45153f2845174e75b70bc01c (patch)
tree536a9f574a41a327abf6d6697b83f4d4fb6539a8
parent1c38c2acf147557e1c3041af70621e7d851c2ef1 (diff)
Fix clamp crash during database initialization due to CryptoUtils not properly initialized. Change-Id: Iff080c7ab482cda98eb9ec58f2648cfce877bb96 Issue-ID: CLAMP-70 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
-rw-r--r--src/main/java/org/onap/clamp/clds/util/CryptoUtils.java22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java b/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java
index 86f57dce..4b72c6fd 100644
--- a/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java
+++ b/src/main/java/org/onap/clamp/clds/util/CryptoUtils.java
@@ -25,14 +25,11 @@ package org.onap.clamp.clds.util;
import java.security.GeneralSecurityException;
-import javax.annotation.PostConstruct;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
-import org.springframework.core.annotation.Order;
import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
@@ -43,20 +40,9 @@ import org.springframework.stereotype.Component;
@Component("CryptoUtils")
@Order(Ordered.HIGHEST_PRECEDENCE)
public final class CryptoUtils {
- public static final String AES = "AES";
- public static final String KEY_PARAM = "org.onap.clamp.encryption.aes.key";
- @Autowired
- private Environment springEnv;
- private SecretKeySpec secretKeySpec;
-
- /**
- * Initialize Method
- *
- */
- @PostConstruct
- public void init() {
- secretKeySpec = getSecretKeySpec(springEnv.getProperty(KEY_PARAM));
- }
+ public static final String AES = "AES";
+ public static final String KEY_PARAM = "org.onap.clamp.encryption.aes.key";
+ private SecretKeySpec secretKeySpec = getSecretKeySpec("aa3871669d893c7fb8abbcda31b88b4f");
/**
* Encrypt a value based on the Clamp Encryption Key.