static KeyStore getCertificateStoreInstance(String cacertsPath)
			throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException {

		int certCount = 0;

		KeyStore store = KeyStore.getInstance(KeyStore.getDefaultType());
		store.load(null);

		InputStream fis = new FileInputStream(cacertsPath);
		BufferedInputStream bis = new BufferedInputStream(fis);

		try {
			CertificateFactory cf = CertificateFactory.getInstance("X.509");
			while (bis.available() > 0) {
				try {
					Certificate cert = cf.generateCertificate(bis);
					if (cert instanceof X509Certificate) {
						X509Certificate x509Cert = (X509Certificate) cert;
						String name = getCommonName(x509Cert.getSubjectDN());
						store.setCertificateEntry(name, cert);
						++certCount;
					}
				}
				catch (CertificateException e) {
					// Must handle blank lines at bottom of file
					Throwable cause = e.getCause();
					if (cause != null && "Empty input".equals(cause.getMessage())) {
						break; // end of file
					}
					throw e;
				}
			}
		}
		finally {
			bis.close();
		}
		if (certCount == 0) {
			// Processing JKS files above produce "Empty input", if no certs read
			// try reading as keystore without password 
			return getKeyStoreInstance(cacertsPath, null);
		}
		return store;
	}
Load the specified X.509 certificate authority store in a standard
X.509 form (*.pem, *.crt, *.cer, *.der) or Java JKS (*.jks) form.
@param cacertsPath certificate store file path
@return KeyStore containing ingested certificates
@throws IOException
@throws KeyStoreException
@throws NoSuchAlgorithmException
@throws CertificateException
Ghidra/Framework/Generic/src/main/java/ghidra/net/ApplicationKeyStore.java