diff options
author | alx | 2019-03-16 23:56:27 +0300 |
---|---|---|
committer | alx | 2019-03-16 23:56:27 +0300 |
commit | 06105f76dbfa3b65e63ed06f9c4d5107bd49ed88 (patch) | |
tree | 5702c01cec9688039d891f4a711878706101c1c5 /src/main/java/com/juick/server/KeystoreManager.java | |
parent | 3ea4cd1942fa4e763034da11c5fa429407b67829 (diff) | |
parent | a49105285d0d7719d7f222a507af2d5ac5b4bdb1 (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main/java/com/juick/server/KeystoreManager.java')
-rw-r--r-- | src/main/java/com/juick/server/KeystoreManager.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/com/juick/server/KeystoreManager.java b/src/main/java/com/juick/server/KeystoreManager.java index 67a24f11..3ae7b866 100644 --- a/src/main/java/com/juick/server/KeystoreManager.java +++ b/src/main/java/com/juick/server/KeystoreManager.java @@ -19,20 +19,17 @@ import java.security.spec.X509EncodedKeySpec; import java.util.Arrays; import java.util.stream.Collectors; -@Component public class KeystoreManager { private static final Logger logger = LoggerFactory.getLogger("com.juick.server"); - @Value("${keystore:juick.p12}") - private String keystore; - @Value("${keystore_password:secret}") + private String keystorePassword; private KeyStore ks; private KeyManagerFactory kmf; - @PostConstruct - public void init() { + public KeystoreManager(String keystore, String keystorePassword) { + this.keystorePassword = keystorePassword; try (InputStream ksIs = new FileInputStream(keystore)) { ks = KeyStore.getInstance("PKCS12"); ks.load(ksIs, keystorePassword.toCharArray()); |