diff options
author | Determe, Sebastien (sd378r) <sd378r@intl.att.com> | 2017-11-07 17:58:12 +0100 |
---|---|---|
committer | Determe, Sebastien (sd378r) <sd378r@intl.att.com> | 2017-11-07 17:58:12 +0100 |
commit | 73f5f8ba2480fc8d45153f2845174e75b70bc01c (patch) | |
tree | 536a9f574a41a327abf6d6697b83f4d4fb6539a8 /src/main/java/org/onap | |
parent | 1c38c2acf147557e1c3041af70621e7d851c2ef1 (diff) |
Fix Clamp crash
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>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r-- | src/main/java/org/onap/clamp/clds/util/CryptoUtils.java | 22 |
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 86f57dcee..4b72c6fdd 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. |