git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@750 96b47cad-a561-4643-ad3b-153ac7d7599c
72 lines
2.4 KiB
Plaintext
72 lines
2.4 KiB
Plaintext
#! @PYTHON@
|
|
#
|
|
# Copyright (C) 2010-2012 Frank Morgner <morgner@informatik.hu-berlin.de>
|
|
# Copyright (C) 2010 Dominik Oepen <oepen@informatik.hu-berlin.de>
|
|
#
|
|
# 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 <http://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
import argparse
|
|
|
|
|
|
parser = argparse.ArgumentParser(
|
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
description='''
|
|
The @PACKAGE_NAME@ emulates different types of smart cards.
|
|
|
|
The emulator connects to the virtual smart card reader reader (vpcd). Smart
|
|
card applications can access the @PACKAGE_NAME@ through the vpcd via PC/SC.
|
|
|
|
Report bugs to @PACKAGE_BUGREPORT@
|
|
''',
|
|
epilog='''
|
|
Written by Frank Morgner <morgner@informatik.hu-berlin.de> and Dominik Oepen
|
|
<oepen@informatik.hu-berlin.de>
|
|
''')
|
|
|
|
parser.add_argument("-t", "--type",
|
|
action="store",
|
|
choices=['iso7816', 'cryptoflex', 'ePass', 'nPA', 'relay'],
|
|
default='iso7816',
|
|
help="Type of smart card to emulate")
|
|
parser.add_argument("-f", "--file",
|
|
action="store",
|
|
type=argparse.FileType('r'),
|
|
help="load a saved smart card image")
|
|
parser.add_argument("-H", "--hostname",
|
|
action="store",
|
|
type=str,
|
|
default='localhost',
|
|
help="address of the vpcd")
|
|
parser.add_argument("-P", "--port",
|
|
action="store",
|
|
type=int,
|
|
default=35963,
|
|
help="port of the vpcd")
|
|
|
|
relay = parser.add_argument_group('options for relaying a local smart card')
|
|
relay.add_argument("-r", "--reader",
|
|
action="store",
|
|
type=int,
|
|
help="number of the reader which contains the smart card to be relayed.")
|
|
|
|
args = parser.parse_args()
|
|
|
|
from virtualsmartcard.VirtualSmartcard import VirtualICC
|
|
vicc = VirtualICC(args.file, args.type,
|
|
args.hostname, args.port, readernum=args.reader)
|
|
vicc.run()
|