#! @PYTHON@ # # # Copyright (C) 2011 Frank Morgner, Dominik Oepen # # This file is part of virtualsmartcard. # # virtualsmartcard is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # virtualsmartcard is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # virtualsmartcard. If not, see . # import argparse parser = argparse.ArgumentParser('Virtual Smart Card') parser.add_argument("-f", "--file", action="store", type=str, default=None, help="Load a saved card") parser.add_argument("-n", "--hostname", action="store", type=str, default='localhost', help="Address of Virtual PCD [default: %default]") parser.add_argument("-p", "--port", action="store", type=int, default=35963, help="Port of Virtual PCD [default: %default]") parser.add_argument("-r", "--reader", action="store", type=int, default=None, help="Number of reader for relaying") parser.add_argument("-t", "--type", action="store", default='iso7816', choices=['iso7816', 'cryptoflex', 'ePass', 'nPA', 'relay'], help="Type of Smartcard [default: %default]") args = parser.parse_args() from virtualsmartcard.VirtualSmartcard import VirtualICC vicc = VirtualICC(args.file, args.type, args.hostname, args.port, readernum=args.reader) vicc.run()