(build, signtool, target, certificate = None, certificate_path = None, certificate_password = "")
Sign a single executable file
Sign a single executable file
Sign a single executable file
def _sign_executable(build, signtool, target, certificate = None, certificate_path = None, certificate_password = ""):
	'Sign a single executable file'

	LOG.info('Signing {target}'.format(target=target))

	if signtool == 'signtool':
		command = lib.PopenWithoutNewConsole('signtool sign /f {cert} /p {password} /v /t {time} "{target}"'.format(
			cert=path.join(certificate_path, certificate),
			password=certificate_password,
			time='http://timestamp.comodoca.com/authenticode',
			target=target),
			stdout=PIPE, stderr=STDOUT, shell=True
		)

	elif signtool == 'osslsigncode': 
		command = lib.PopenWithoutNewConsole('osslsigncode -pkcs12 {cert} -pass {password} -t {time} -in "{target}" -out "{target}.signed"'.format(
			cert=path.join(certificate_path, certificate),
			password=certificate_password,
			time='http://timestamp.comodoca.com/authenticode',
			target=target),
			stdout=PIPE, stderr=STDOUT, shell=True
		)

	else:
		raise IEError("problem signing IE build, unknown code sign tool: {signtool}".format(signtool=signtool))

	out, err = command.communicate()
	if command.returncode != 0:
		raise IEError("problem signing IE build: {stdout}".format(stdout=out))

	if signtool == 'osslsigncode':
		shutil.move(target + ".signed", target)
def _sign_executable ( build , signtool , target , certificate = None , certificate_path = None , certificate_password = "" ) : LOG . info ( 'Signing {target}' . format ( target = target ) ) if signtool == 'signtool' : command = lib . PopenWithoutNewConsole ( 'signtool sign /f {cert} /p {password} /v /t {time} "{target}"' . format ( cert = path . join ( certificate_path , certificate ) , password = certificate_password , time = 'http://timestamp.comodoca.com/authenticode' , target = target ) , stdout = PIPE , stderr = STDOUT , shell = True ) elif signtool == 'osslsigncode' : command = lib . PopenWithoutNewConsole ( 'osslsigncode -pkcs12 {cert} -pass {password} -t {time} -in "{target}" -out "{target}.signed"' . format ( cert = path . join ( certificate_path , certificate ) , password = certificate_password , time = 'http://timestamp.comodoca.com/authenticode' , target = target ) , stdout = PIPE , stderr = STDOUT , shell = True ) else : raise IEError ( "problem signing IE build, unknown code sign tool: {signtool}" . format ( signtool = signtool ) ) out , err = command . communicate ( ) if command . returncode != 0 : raise IEError ( "problem signing IE build: {stdout}" . format ( stdout = out ) ) if signtool == 'osslsigncode' : shutil . move ( target + ".signed" , target )