public JsonObject loadOptionalFooter(CartV1Decryptor decryptor)
			throws CartInvalidCartException, CartInvalidARC4KeyException, IOException {
		byte[] encryptedOptionalFooter = null;

		if (optionalFooterLength > 0 &&
			(optionalFooterPosition + optionalFooterLength) == footerPosition &&
			(optionalFooterPosition + optionalFooterLength) < readerLength) {
			try {
				encryptedOptionalFooter = internalReader.readByteArray(optionalFooterPosition,
					(int) optionalFooterLength);
			}
			catch (IOException e) {
				// ignore
			}
		}

		if (encryptedOptionalFooter != null) {
			String decryptedOptionalFooter = decryptor.decryptToString(encryptedOptionalFooter);

			if (decryptedOptionalFooter == null) {
				throw new CartInvalidARC4KeyException("CaRT optional footer decryption failed.");
			}

			try {
				optionalFooterData =
					JsonParser.parseString(decryptedOptionalFooter).getAsJsonObject();
			}
			catch (IllegalStateException | JsonSyntaxException e) {
				throw new CartInvalidARC4KeyException(
					"CaRT decrypted optional footer not valid JSON.");
			}
		}

		// If there was no encrypted optional footer or parsing failed without an exception and
		// parseString returns `null` then set to empty JSON object
		if (optionalFooterData == null) {
			optionalFooterData = new JsonObject();
		}

		return optionalFooterData();
	}
Read and decrypt optional footer data and return a copy.

@param decryptor An initialize decryptor with the correct ARC4 key
@return JsonObject read and decrypted from the footer. Will be empty if no
        optional footer is available.
@throws CartInvalidCartException    If the footer object is not valid.
@throws CartInvalidARC4KeyException If the decryption of JSON deserialization
                                    fails.
@throws IOException                 If there is a failure to read the footer data.
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/cart/CartV1Footer.java