public static synchronized boolean setKeyStore(String path, boolean savePreference) {

		if (System.getProperty(KEYSTORE_PATH_PROPERTY) != null) {
			Msg.showError(ApplicationKeyManagerFactory.class, null, "Set KeyStore Failed",
				"PKI KeyStore was set via system property and can not be changed");
			return false;
		}

		path = prunePath(path);

		try {
			boolean keyInitialized = getKeyManagerWrapper().init(path);

			if (savePreference && (path == null || keyInitialized)) {
				Preferences.setProperty(KEYSTORE_PATH_PROPERTY, path);
				Preferences.store();
			}
			return keyInitialized;
		}
		catch (CancelledException e) {
			// ignore - keystore left unchanged
			return false;
		}
	}
Set user keystore file path (e.g., certificate file with private key).
This method will have no effect if the keystore had been set via the system
property and an error will be displayed.  Otherwise, the keystore will
be updated and the key manager re-initialized.  The user preference will be
updated unless a failure occurred while attempting to open the keystore.
This change will take immediate effect for the current executing application,
however, it may still be superseded by a system property setting when running
the application in the future. See {@link #getKeyStore()}.
@param path keystore file path or null to clear current key store and preference.
@param savePreference if true will be saved as user preference
@return true if successful else false if error occured (see log).
Ghidra/Framework/Generic/src/main/java/ghidra/net/ApplicationKeyManagerFactory.java