diff options
author | Vitaly Takmazov | 2019-12-12 11:28:12 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-12-12 11:28:12 +0300 |
commit | f462d7335567960978e16c5e042c99b54daa94b6 (patch) | |
tree | f298f3ac50ed64d0292bba0a8a6e148e8daa434c /src/main/java/com/juick/server/KeystoreManager.java | |
parent | c0ae480bb5c07ea7b9e1b42df428e2857b0d4816 (diff) |
Cleanup IDEA code issues
Diffstat (limited to 'src/main/java/com/juick/server/KeystoreManager.java')
-rw-r--r-- | src/main/java/com/juick/server/KeystoreManager.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/com/juick/server/KeystoreManager.java b/src/main/java/com/juick/server/KeystoreManager.java index b1ce7a56..15b62e35 100644 --- a/src/main/java/com/juick/server/KeystoreManager.java +++ b/src/main/java/com/juick/server/KeystoreManager.java @@ -23,14 +23,12 @@ public class KeystoreManager { private KeyStore ks; - private KeyManagerFactory kmf; - public KeystoreManager(Resource keystore, String keystorePassword) { this.keystorePassword = keystorePassword; try (InputStream ksIs = keystore.getInputStream()) { ks = KeyStore.getInstance("PKCS12"); ks.load(ksIs, keystorePassword.toCharArray()); - kmf = KeyManagerFactory.getInstance(KeyManagerFactory + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory .getDefaultAlgorithm()); kmf.init(ks, keystorePassword.toCharArray()); } catch (IOException | KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException | CertificateException e) { @@ -58,7 +56,7 @@ public class KeystoreManager { public String getPublicKeyPem() { String[] key = Base64Utils.encodeToString(getKeyPair().getPublic().getEncoded()).split("(?<=\\G.{64})"); return String.format("-----BEGIN PUBLIC KEY-----\n%s\n-----END PUBLIC KEY-----\n", - Arrays.asList(key).stream().collect(Collectors.joining("\n"))); + String.join("\n", key)); } public static PublicKey publicKeyOf(Person person) { String pubkeyPem = person.getPublicKey().getPublicKeyPem(); |