public static X500Principal[] getTrustedIssuers() throws CertificateException {

		TrustManager[] trustManagers = ApplicationTrustManagerFactory.getTrustManagers();
		if (ApplicationTrustManagerFactory.hasCertError()) {
			throw new CertificateException("failed to load CA certs",
				ApplicationTrustManagerFactory.getCertError());
		}

		Set<X500Principal> set = new HashSet<>();

		boolean openTrust = true;
		for (TrustManager trustManager : trustManagers) {
			if (!(trustManager instanceof X509TrustManager)) {
				Msg.warn(ApplicationKeyManagerUtils.class,
					"Unexpected trust manager implementation: " +
						trustManager.getClass().getName());
				openTrust = false;
				continue;
			}
			X509TrustManager x509TrustManager = (X509TrustManager) trustManager;
			X509Certificate[] acceptedIssuers = x509TrustManager.getAcceptedIssuers();
			if (acceptedIssuers != null) {
				openTrust = false;
				for (X509Certificate trustedCert : acceptedIssuers) {
					set.add(trustedCert.getSubjectX500Principal());
				}
			}
		}

		if (openTrust) {
			return null;// trust all authorities
		}

		X500Principal[] principals = new X500Principal[set.size()];
		return set.toArray(principals);
	}
Returns a list of trusted issuers (i.e., CA certificates) as established
by the {@link ApplicationTrustManagerFactory}.
@return array of trusted Certificate Authorities
@throws CertificateException if failed to properly initialize trust manager
due to CA certificate error(s).
Ghidra/Framework/Generic/src/main/java/ghidra/net/ApplicationKeyManagerUtils.java