risdenk commented on a change in pull request #54: [WIP] KNOX-1756 - Knox
Gateway TLS Keystore and Alias Should be Configurable
URL: https://github.com/apache/knox/pull/54#discussion_r258102739
##########
File path:
gateway-spi/src/main/java/org/apache/knox/gateway/services/security/impl/BaseKeystoreService.java
##########
@@ -39,28 +39,26 @@
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
-public class BaseKeystoreService {
+abstract class BaseKeystoreService {
private static GatewaySpiMessages LOG = MessagesFactory.get(
GatewaySpiMessages.class );
- protected MasterService masterService;
- protected String keyStoreDir;
+ private MasterService masterService;
- private static KeyStore loadKeyStore(final File keyStoreFile, final char[]
masterPassword, String storeType)
+ private static KeyStore loadKeyStore(final File keyStoreFile, final char[]
storePassword, String storeType)
throws CertificateException, IOException, KeyStoreException,
NoSuchAlgorithmException {
final KeyStore keyStore = KeyStore.getInstance(storeType);
if ( keyStoreFile.exists() ) {
try (InputStream input =
Files.newInputStream(keyStoreFile.toPath())) {
- keyStore.load( input, masterPassword );
+ keyStore.load( input, storePassword );
}
} else {
- keyStore.load( null, masterPassword );
+ keyStore.load( null, storePassword );
}
return keyStore;
}
- private static OutputStream createKeyStoreFile(String fileName ) throws
IOException {
- File file = new File( fileName );
+ private static OutputStream createKeyStoreFile(File file) throws IOException
{
Review comment:
Since we are changing the method signature anyway, can we go with `Path`
instead of `File`?
`Path` is preferred to `File`.
https://docs.oracle.com/javase/tutorial/essential/io/legacy.html
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services