summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
1c38c2a)
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>
import java.security.GeneralSecurityException;
import java.security.GeneralSecurityException;
-import javax.annotation.PostConstruct;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
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.Ordered;
+import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
import org.springframework.stereotype.Component;
/**
@Component("CryptoUtils")
@Order(Ordered.HIGHEST_PRECEDENCE)
public final class CryptoUtils {
@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.
/**
* Encrypt a value based on the Clamp Encryption Key.