def do_verify(marfile, keyfiles=None):
try:<EOL><INDENT>with open(marfile, '<STR_LIT:rb>') as f:<EOL><INDENT>with MarReader(f) as m:<EOL><INDENT>errors = m.get_errors()<EOL>if errors:<EOL><INDENT>print("<STR_LIT>".format(errors))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>if keyfiles:<EOL><INDENT>try:<EOL><INDENT>keys = get_keys(keyfiles, m.signature_type)<EOL><DEDENT>except ValueError as e:<EOL><INDENT>print(e)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>if any(m.verify(key) for key in keys):<EOL><INDENT>print("<STR_LIT>")<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL>return True<EOL><DEDENT><DEDENT><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>print("<STR_LIT>".format(e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>
Verify the MAR file.