os = RelayOS ( readernum, mitm = mitm ) elif card_type = 'handler_test' : from import HandlerTestOS self. os = CryptoflexOS ( MF, SAM ) elif card_type = 'relay' : from import RelayOS from import RelayMiddleman mitm = loadMitMFromPath ( mitmPath ) if mitmPath else RelayMiddleman () self. os = NPAOS ( MF, SAM, ef_cardsecurity = ef_cardsecurity, ef_cardaccess = ef_cardaccess, ca_key = ca_key, cvca = cvca, disable_checks = disable_checks, esign_key = esign_key, esign_ca_cert = esign_ca_cert, esign_cert = esign_cert ) elif card_type = 'cryptoflex' : from import CryptoflexOS self. os = Iso7816OS ( MF, SAM ) elif card_type = 'nPA' : from import NPAOS self. getCard () # Generate an OS object of the correct card_type if card_type = 'iso7816' or card_type = 'ePass' : self. readDatagroups ( datasetfile ) MF, SAM = self. info ( 'Reading Data Groups from file %s. cardGenerator = CardGenerator ( card_type ) # If a dataset file is specified, read the card's data groups from disk if datasetfile is not None : if exists ( datasetfile ): logging. basicConfig ( level = logginglevel, format = ' %(asctime)s %(message)s ', datefmt = ' %d. INFO ): from os.path import exists logging. Def _init_ ( self, datasetfile, card_type, host, port, readernum = None, mitmPath = None, ef_cardsecurity = None, ef_cardaccess = None, ca_key = None, cvca = None, disable_checks = False, esign_key = None, esign_ca_cert = None, esign_cert = None, logginglevel = logging.