code: public static KeyStore loadKeyStore(InputStream keyStore, String password)
              throws CertificateException, NoSuchAlgorithmException, IOException, KeyStoreException {
          try {
              KeyStore trustStore = KeyStore.getInstance("JKS");
              trustStore.load(keyStore, password.toCharArray());
              return trustStore;
          } finally {
              IOUtils.closeQuietly(keyStore);
          }
      }
docs: Loads keystore
  
  @param keyStore Keystore InputStream
  @param password Keystore password
  @return Loaded Keystore
  @throws CertificateException     In case of Certificate error
  @throws NoSuchAlgorithmException If no such algorithm present
  @throws IOException              In case if some IO errors
  @throws KeyStoreException        If there is some error with KeyStore