def METHOD_NAME(self, argv):
    try:
        opts, _ = getopt.gnu_getopt(argv, 'i:v', [
            'instance=', 'pkcs12-file=', 'pkcs12-password=', 'pkcs12-password-file=',
            'no-key',
            'verbose', 'debug', 'help'])
    except getopt.GetoptError as e:
        print('ERROR: ' + str(e))
        self.print_help()
        sys.exit(1)
    instance_name = 'pki-tomcat'
    pkcs12_file = None
    pkcs12_password = None
    no_key = False
    for o, a in opts:
        if o in ('-i', '--instance'):
            instance_name = a
        elif o == '--pkcs12-file':
            pkcs12_file = a
        elif o == '--pkcs12-password':
            pkcs12_password = a.encode()
        elif o == '--pkcs12-password-file':
            with io.open(a, 'rb') as f:
                pkcs12_password = f.read()
        elif o == '--no-key':
            no_key = True
        elif o == '--debug':
            logging.getLogger().setLevel(logging.DEBUG)
        elif o in ('-v', '--verbose'):
            logging.getLogger().setLevel(logging.INFO)
        elif o == '--help':
            self.print_help()
            sys.exit()
        else:
            logger.error('Unknown option: %s', o)
            self.print_help()
            sys.exit(1)
    if not pkcs12_file:
        logger.error('Missing PKCS #12 file')
        self.print_help()
        sys.exit(1)
    if not pkcs12_password:
        logger.error('Missing PKCS #12 password')
        self.print_help()
        sys.exit(1)
    instance = pki.server.instance.PKIServerFactory.create(instance_name)
    if not instance.exists():
        logger.error('Invalid instance %s.', instance_name)
        sys.exit(1)
    instance.load()
    subsystem = instance.get_subsystem('tks')
    if not subsystem:
        logger.error('No TKS subsystem in instance %s.', instance_name)
        sys.exit(1)
    tmpdir = tempfile.mkdtemp()
    try:
        pkcs12_password_file = os.path.join(tmpdir, 'pkcs12_password.txt')
        with open(pkcs12_password_file, 'wb') as f:
            f.write(pkcs12_password)
        subsystem.export_system_cert(
            'subsystem', pkcs12_file, pkcs12_password_file, no_key=no_key)
        subsystem.export_system_cert(
            'audit_signing', pkcs12_file, pkcs12_password_file, no_key=no_key, append=True)
        instance.export_external_certs(
            pkcs12_file, pkcs12_password_file, append=True)
    finally:
        shutil.rmtree(tmpdir)