Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The clientKey manager performs some of the work that could be done as part of creating the key store.
Since the manager is potentially called many times, it would be better to move the setup processing to the creation of the keystore.
This requires creating a sub-class of KeyStore, which might as well be a private class created by createClientKeyManager()
The calling sequence would then be:
KeyManager km = KeyManagerUtils.createClientKeyManager( "JKS", "/path/to/privatekeystore.jks", "storepassword", "privatekeyalias", "keypassword"); FTPSClient cl = new FTPSClient(); cl.setKeyManager(km);
For JKS stores with a single entry and keypassword == storepassword this would simplify to:
KeyManager km = KeyManagerUtils.createClientKeyManager("/path/to/privatekeystore.jks", "storepassword"); FTPSClient cl = new FTPSClient(); cl.setKeyManager(km);