Details
Description
FileKeystoreInstance.getKeyManager() fails when there is more than one privatekey in the store.
Scenario 1: The method will throw UnrecoverableKeyException if the all the private key entries in the keystore do not have the same password (as the entry of our interest).
Scenario 2: Even if all the private key entries have the same password and the method returns a KeyManager, there is no control on which enrty will be used.
To overcome this, a temporary keystore (I call it a SubKeystore) can be generated and initialized with the entry corresponding to the alias and used to init the KeyManagerFactory.