def METHOD_NAME(key_path, cert_path, alias, gf_domain_name, gf_domain_dir=None):
	print("Uploading keypair using asadmin: ", end='')
	try:
		if gf_domain_dir is None:
			check_call([ASADMIN_PATH, "add-pkcs8", "--domain_name", gf_domain_name, "--destalias", alias, "--priv-key-path", key_path, "--cert-chain-path", cert_path], stdout=FNULL, stderr=FNULL)
		else:
			check_call([ASADMIN_PATH, "add-pkcs8", "--domain_name", gf_domain_name, "--domaindir", gf_domain_dir, "--destalias", alias, "--priv-key-path", key_path, "--cert-chain-path", cert_path], stdout=FNULL, stderr=FNULL)
	except CalledProcessError: 
		print('[' + FAIL + "FAIL" + ENDC + ']' + "\n", sys.exc_info()[1])
		return 1
	print('[' + OKGREEN + " OK " + ENDC + ']')
	return 0