fix: Remove placeholder fields from initial impl
This commit is contained in:
parent
8ffac7e02c
commit
d3ca9ae8d6
1 changed files with 2 additions and 4 deletions
|
@ -34,8 +34,6 @@ public class KeyStoreManager {
|
||||||
throws JavaSecurityException {
|
throws JavaSecurityException {
|
||||||
try {
|
try {
|
||||||
Path keystorePath = Files.createTempFile("keystore", ".jks");
|
Path keystorePath = Files.createTempFile("keystore", ".jks");
|
||||||
String keystorePassword = "changeit";
|
|
||||||
String alias = "mykey";
|
|
||||||
|
|
||||||
// Load the keystore
|
// Load the keystore
|
||||||
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
|
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
|
||||||
|
@ -47,12 +45,12 @@ public class KeyStoreManager {
|
||||||
passwordProvider.getPasswordFor(serverCert.fingerprint())
|
passwordProvider.getPasswordFor(serverCert.fingerprint())
|
||||||
);
|
);
|
||||||
Certificate[] certChain = loadCertificateChain(serverCert.fullchainPath());
|
Certificate[] certChain = loadCertificateChain(serverCert.fullchainPath());
|
||||||
keystore.setKeyEntry(alias, privateKey, keystorePassword.toCharArray(), certChain);
|
keystore.setKeyEntry(serverCert.fingerprint(), privateKey, null, certChain);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the keystore
|
// Save the keystore
|
||||||
try (var keystoreOut = Files.newOutputStream(keystorePath, CREATE_TRUNCATE)) {
|
try (var keystoreOut = Files.newOutputStream(keystorePath, CREATE_TRUNCATE)) {
|
||||||
keystore.store(keystoreOut, keystorePassword.toCharArray());
|
keystore.store(keystoreOut, keyStorePassphrase.toCharArray());
|
||||||
}
|
}
|
||||||
return new KeystoreResult(keystorePath);
|
return new KeystoreResult(keystorePath);
|
||||||
} catch (IOException | KeyStoreException | NoSuchAlgorithmException | CertificateException e) {
|
} catch (IOException | KeyStoreException | NoSuchAlgorithmException | CertificateException e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue