aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/KeystoreManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/server/KeystoreManager.java')
-rw-r--r--src/main/java/com/juick/server/KeystoreManager.java9
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 3ae7b866..61caba82 100644
--- a/src/main/java/com/juick/server/KeystoreManager.java
+++ b/src/main/java/com/juick/server/KeystoreManager.java
@@ -3,13 +3,10 @@ package com.juick.server;
import com.juick.server.api.activity.model.objects.Person;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
+import org.springframework.core.io.Resource;
import org.springframework.util.Base64Utils;
-import javax.annotation.PostConstruct;
import javax.net.ssl.KeyManagerFactory;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.*;
@@ -28,9 +25,9 @@ public class KeystoreManager {
private KeyManagerFactory kmf;
- public KeystoreManager(String keystore, String keystorePassword) {
+ public KeystoreManager(Resource keystore, String keystorePassword) {
this.keystorePassword = keystorePassword;
- try (InputStream ksIs = new FileInputStream(keystore)) {
+ try (InputStream ksIs = keystore.getInputStream()) {
ks = KeyStore.getInstance("PKCS12");
ks.load(ksIs, keystorePassword.toCharArray());
kmf = KeyManagerFactory.getInstance(KeyManagerFactory