def METHOD_NAME(cls, path: Union[str, BytesIO]) -> "FirmwareContainer":
    with ZipFile(path) as z:
        checksum_lines = z.read("sha256sums").decode("utf-8").splitlines()
        checksum_pairs = [line.split("  ", maxsplit=1) for line in checksum_lines]
        checksums = {path: checksum for checksum, path in checksum_pairs}
        manifest_bytes = z.read("manifest.json")
        _validate_checksum(checksums, "manifest.json", manifest_bytes)
        manifest = json.loads(manifest_bytes)
        if manifest["device"] != "Nitrokey 3":
            raise Exception(
                f"Unexpected device value in manifest: {manifest['device']}"
            )
        version = Version.from_v_str(manifest["version"])
        pynitrokey = None
        if "pynitrokey" in manifest:
            pynitrokey = Version.from_v_str(manifest["pynitrokey"])
        images = {}
        for variant, image in manifest["images"].items():
            image_bytes = z.read(image)
            _validate_checksum(checksums, image, image_bytes)
            images[Variant.from_str(variant)] = image_bytes
        return cls(
            version=version,
            pynitrokey=pynitrokey,
            images=images,
        )