def pkg_signed(filename):
	xar_args = [XAR_PATH,
		'-t', # only test archive
		'--dump-toc=-',
		'-f',
		filename]

	p = subprocess.Popen(xar_args, stdout=subprocess.PIPE)
	toc, _ = p.communicate()

	if p.returncode != 0:
		return False

	toc_md = parseString(toc)

	# for purposes of checking just see if the xar TOC has an X509Certificate element
	return len(toc_md.getElementsByTagName('X509Certificate')) > 0
dataset/ETHPy150Open jessepeterson/commandment/commandment/utils/app_manifest.py/pkg_signed/original