private String getPasswordForFile(GFile file, ISimpleInArchiveItem encryptedItem,
			TaskMonitor monitor) {
		FSRL containerFSRL = fsFSRL.getContainer();
		int itemIndex = encryptedItem.getItemIndex();
		if (!passwords.containsKey(itemIndex)) {
			try (CryptoSession cryptoSession = fsService.newCryptoSession()) {
				String prompt = passwords.isEmpty()
						? containerFSRL.getName()
						: "%s in %s".formatted(file.getName(), containerFSRL.getName());
				for (Iterator<Password> pwIt =
					cryptoSession.getPasswordsFor(containerFSRL, prompt); pwIt.hasNext();) {
					try (Password passwordValue = pwIt.next()) {
						monitor.setMessage("Testing password for " + file.getName());

						String password = String.valueOf(passwordValue.getPasswordChars());	// we are forced to use strings by 7zip's api
						int[] encryptedItemIndexes = getEncryptedItemIndexes();
						TestPasswordsCallback testCB =
							new TestPasswordsCallback(password, encryptedItemIndexes[0], monitor);

						// call the SZ extract method using "TEST" mode (ie. no bytes are extracted)
						// on any files that don't have a password yet 
						archive.extract(encryptedItemIndexes, true /* test mode */, testCB);
						List<Integer> successFileIndexes = testCB.getSuccessFileIndexes();
						for (Integer unlockedFileIndex : successFileIndexes) {
							passwords.put(unlockedFileIndex, password);
						}
						if (!successFileIndexes.isEmpty()) {
							cryptoSession.addSuccessfulPassword(containerFSRL, passwordValue);
						}
						if (passwords.containsKey(itemIndex)) {
							break;
						}
					}
					catch (SevenZipException e) {
						Msg.error(this, "Error when testing password for " + file.getFSRL(), e);
						return null;
					}
				}
			}
		}
		return passwords.get(itemIndex);

	}
Opens the specified sevenzip container file and initializes this file system with the
contents.

@param byteProvider container file 
@param monitor {@link TaskMonitor} to allow the user to monitor and cancel
@throws CancelledException if user cancels
@throws IOException if error when reading data
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/sevenzip/SevenZipFileSystem.java