def METHOD_NAME(profile_path) -> Optional[str]:
  try:
    plist = subprocess.check_output(
        ["security", "cms", "-D", "-i", profile_path])
    profile = plistlib.loads(plist)
    return profile["Entitlements"]["application-identifier"]
  except Exception:  # pylint: disable=broad-except
    return None