code: private static TrustManagerFactory getTrustManagerFactory(InputStream trustStoreStream, 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(trustStoreStream, storeProperties.getPassword().toCharArray());
      TrustManagerFactory tmf = TrustManagerFactory.getInstance(storeProperties.getManagerType());
      tmf.init(ks);
      return tmf;
    }
docs: Build TrustManagerFactory.
  @param trustStoreStream Truststore input stream
  @param storeProperties store properties
  @return TrustManagerFactory
  @throws IOException
  @throws GeneralSecurityException