docs: void setCertificateToTruststore(X509Certificate[] chain) throws Exception {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.entry(tc, "setCertificateToTruststore");
  
          try {
  
              WSKeyStore wsks = KeyStoreManager.getInstance().getKeyStore(tsCfgAlias);
              if (wsks == null)
                  throw (new Exception("Keystore " + tsCfgAlias + " does not exist in the configuration."));
              if (wsks.getReadOnly()) {
                  issueMessage("ssl.keystore.readonly.CWPKI0810I",
                               new Object[] { tsCfgAlias },
                               "The "
                                               + tsCfgAlias
                                               + " keystore is read only and the certificate will not be written to the keystore file.  Trust will be accepted only for this connection.");
  
              } else {
                  for (int j = 0; j < chain.length; j++) {
                      String alias = chain[j].getSubjectDN().getName();
                      alias = alias.trim();
  
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "Adding alias \"" + alias + "\" to truststore \"" + tsFile + "\".");
                      wsks.setCertificateEntry(alias, chain[chain.length - 1]);
                      String shaDigest = KeyStoreManager.getInstance().generateDigest("SHA-1", chain[chain.length - 1]);
  
                      issueMessage("ssl.signer.add.to.local.truststore.CWPKI0308I", new Object[] { alias, tsFile, shaDigest }, "CWPKI0308I: Adding signer alias \"" + alias
                                                                                                                               + "\" to local keystore \"" + tsFile
                                                                                                                               + "\" with the following SHA digest: " + shaDigest);
  
                      //Certificate is set on the truststore now clear the caches, if the file monitor is on let it handle the change.
                      String trigger = wsks.getTrigger();
                      if (!trigger.equalsIgnoreCase("disabled"))
                          clearSSLCachesAndResetDefault();
                  }
              }
          } catch (Exception e) {
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "Exception while trying to write certificate to the truststore. Exception is " + e.getMessage());
              throw e;
          }
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.exit(tc, "setCertificateToTruststore");
      }