def GetSigner(context): if args.subparser_name in ["repack", "buildandrepack"]: if args.platform == "windows": print "Enter passphrase for code signing cert:" passwd = getpass.getpass() cert = config_lib.CONFIG.Get("ClientBuilder.windows_signing_cert", context=context) key = config_lib.CONFIG.Get("ClientBuilder.windows_signing_key", context=context) app_name = config_lib.CONFIG.Get( "ClientBuilder.windows_signing_application_name", context=context) return signing.WindowsCodeSigner(cert, key, passwd, app_name) elif args.platform == "linux" and args.package_format == "rpm": pub_keyfile = config_lib.CONFIG.Get( "ClientBuilder.rpm_signing_key_public_keyfile", context=context) gpg_name = config_lib.CONFIG.Get("ClientBuilder.rpm_gpg_name", context=context) print "Enter passphrase for code signing key %s:" % (gpg_name) passwd = getpass.getpass() return signing.RPMCodeSigner(passwd, pub_keyfile, gpg_name) else: parser.error( "Signing only supported on windows and linux rpms for " "repack, buildandrepack")
def GetSigner(self, context): if "Target:Windows" not in context and "Target:LinuxRpm" not in context: raise RuntimeError( "Signing only supported on windows and linux rpms. Neither target in" " context: %s" % context) passwd = self.GetSigningPassword() if "Target:Windows" in context: cert = config_lib.CONFIG.Get("ClientBuilder.windows_signing_cert", context=context) key = config_lib.CONFIG.Get("ClientBuilder.windows_signing_key", context=context) app_name = config_lib.CONFIG.Get( "ClientBuilder.windows_signing_application_name", context=context) return signing.WindowsCodeSigner(cert, key, passwd, app_name) elif "Target:LinuxRpm" in context: pub_keyfile = config_lib.CONFIG.Get( "ClientBuilder.rpm_signing_key_public_keyfile", context=context) gpg_name = config_lib.CONFIG.Get("ClientBuilder.rpm_gpg_name", context=context) return signing.RPMCodeSigner(passwd, pub_keyfile, gpg_name)
def GetSigner(self, context): if "Target:Windows" not in context and "Target:LinuxRpm" not in context: raise RuntimeError( "Signing only supported on windows and linux rpms. Neither target in" " context: %s" % context) if "Target:Windows" in context: system = platform.system() if system == "Linux": cert = config.CONFIG.Get("ClientBuilder.windows_signing_cert", context=context) key = config.CONFIG.Get("ClientBuilder.windows_signing_key", context=context) app_name = config.CONFIG.Get( "ClientBuilder.windows_signing_application_name", context=context) passwd = self.GetSigningPassword() return signing.WindowsOsslsigncodeCodeSigner( cert, key, passwd, app_name) elif system == "Windows": signing_cmd = config.CONFIG.Get( "ClientBuilder.signtool_signing_cmd", context=context) verification_cmd = config.CONFIG.Get( "ClientBuilder.signtool_verification_cmd", context=context) return signing.WindowsSigntoolCodeSigner( signing_cmd, verification_cmd) else: raise RuntimeError("Signing not supported on platform: %s" % system) elif "Target:LinuxRpm" in context: pub_keyfile = config.CONFIG.Get( "ClientBuilder.rpm_signing_key_public_keyfile", context=context) gpg_name = config.CONFIG.Get("ClientBuilder.rpm_gpg_name", context=context) passwd = self.GetSigningPassword() return signing.RPMCodeSigner(passwd, pub_keyfile, gpg_name)