public static KeyStore loadTruststore(String trustStorePath, Optional<String> trustStorePassword,
    Optional<String> trustStoreType) {

    char[] truststorePassword = trustStorePassword.map(String::toCharArray).orElse(null);
    String type = trustStoreType.orElse(KeyStore.getDefaultType());

    KeyStore trustStore;
    try {
      trustStore = KeyStore.getInstance(type);
    } catch (KeyStoreException e) {
      throw new ClientTrustStoreInitializationException("Invalid trust store type: " + type, e);
    }
    try (InputStream inputStream =
      new BufferedInputStream(Files.newInputStream(new File(trustStorePath).toPath()))) {
      trustStore.load(inputStream, truststorePassword);
    } catch (CertificateException | NoSuchAlgorithmException | IOException e) {
      throw new ClientTrustStoreInitializationException("Trust store load error: " + trustStorePath,
        e);
    }
    return trustStore;
  }
Loads a trustStore from the local fileSystem. Can be used to load the trustStore for the
preferred constructor.
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/Client.java