# # Copyright (C) 2009 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 sys, getpass, anydbm from pickle import loads, dumps from TLVutils import pack from utils import inttostring from SmartcardFilesystem import MF, TransparentStructureEF # pgp directory #self.mf.append(DF(parent=self.mf, #fid=4, dfname='\xd2\x76\x00\x01\x24\x01', bertlv_data=[])) # pkcs-15 directories #self.mf.append(DF(parent=self.mf, #fid=1, dfname='\xa0\x00\x00\x00\x01')) #self.mf.append(DF(parent=self.mf, #fid=2, dfname='\xa0\x00\x00\x03\x08\x00\x00\x10\x00')) #self.mf.append(DF(parent=self.mf, #fid=3, dfname='\xa0\x00\x00\x03\x08\x00\x00\x10\x00\x01\x00')) def generate_iso_card(): from SmartcardSAM import SAM print "Using default SAM. Insecure!!!" sam = SAM("1234", "1234567890") #FIXME: Use user provided data mf = MF(filedescriptor=FDB["DF"], lifecycle=LCB["ACTIVATED"], dfname=None) self.SAM.set_MF(self.mf) return mf, sam def generate_ePass(): from PIL import Image from SmartcardFilesystem import DF from SmartcardSAM import PassportSAM MRZ1 = "P