diff options
author | Vitaly Takmazov | 2018-12-20 09:41:32 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-01-16 16:39:21 +0300 |
commit | 809ef60e18bb8ab7c95db93b7777f3c0ffb30872 (patch) | |
tree | e3d1529ff1c1a2026118a2b856c6366b6b6ea2ef /src/main/java/com/juick/server/KeystoreManager.java | |
parent | 1aea2345966f5026d064a44baaa82bb2d958eb8f (diff) |
HTTPSignatureAuthenticationFilter
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()); |