@Override
	public DmgClientFileSystem create(FSRLRoot targetFSRL, ByteProvider provider,
			FileSystemService fsService, TaskMonitor monitor)
			throws IOException, CancelledException {

		FSRL containerFSRL = provider.getFSRL();
		String dmgName = containerFSRL.getName();

		ByteProvider decryptedProvider;
		if (isEncrypted(provider)) {
			if (containerFSRL.getNestingDepth() < 2) {
				throw new CryptoException("Unable to decrypt DMG data because DMG crypto keys " +
					"are specific to the container it is embedded in and this DMG was not " +
					"in a container");
			}

			// get the name of the iphone.ipsw container so we can lookup our crypto keys
			// based on that.
			String containerName = containerFSRL.getName(1);

			decryptedProvider = fsService.getDerivedByteProvider(containerFSRL, null,
				"decrypted " + containerName, provider.length(),
				() -> new DmgDecryptorStream(containerName, dmgName, provider), monitor);
		}
		else {
			decryptedProvider = provider;
		}

		File decryptedDmgFile = fsService.createPlaintextTempFile(decryptedProvider,
			"ghidra_decrypted_dmg_file", monitor);

		DmgClientFileSystem fs =
			new DmgClientFileSystem(decryptedDmgFile, true, targetFSRL, fsService);
		try {
			fs.mount(monitor);
			return fs;
		}
		catch (IOException ioe) {
			Msg.error(this, "Failed to mount DMG file system " + containerFSRL + ": ", ioe);
			fs.close();
			throw ioe;
		}
	}
Handles probing for and creating {@link DmgClientFileSystem} instances.
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/ios/dmg/DmgClientFileSystemFactory.java