code: private static KeyManagerFactory getKeyManagerFactory(InputStream keyStoreStream, StoreProperties storeProperties)
        throws IOException, GeneralSecurityException {
      // use provider if given, otherwise use the first matching security provider
      final KeyStore ks;
      if (StringUtils.isNotBlank(storeProperties.getProvider())) {
        ks = KeyStore.getInstance(storeProperties.getType(), storeProperties.getProvider());
      }
      else {
        ks = KeyStore.getInstance(storeProperties.getType());
      }
      ks.load(keyStoreStream, storeProperties.getPassword().toCharArray());
      KeyManagerFactory kmf = KeyManagerFactory.getInstance(storeProperties.getManagerType());
      kmf.init(ks, storeProperties.getPassword().toCharArray());
      return kmf;
    }
docs: Get key manager factory
  @param keyStoreStream Keystore input stream
  @param storeProperties store properties
  @return Key manager factory
  @throws IOException
  @throws GeneralSecurityException