Esempio n. 1
0
    def __loadCapFile(self, args):
        if not self.__checkContext(): return
        if not self.__checkCardInfo(): return
        if not self.__checkSecurityInfo(): return

        capFilePath = args[0]
        try:
            self.__handler.handleLog('loadCapFile(): Start ...')
            capFileInfo = gp.readExecutableLoadFileParameters(capFilePath)
            gp.installForLoad(self.__context, self.__cardInfo, self.__securityInfo, capFileInfo['loadFileAID'], gp.AID_ISD, '', '', 0, 0, 0)
            gp.load(self.__context, self.__cardInfo, self.__securityInfo, '', capFilePath)
            self.__handler.handleLog('loadCapFile(): Succeeded.', wx.LOG_Info)
        except Exception, e:
            self.__handler.handleException(e)
Esempio n. 2
0
    def __loadCapFile(self, args):
        if not self.__checkContext(): return
        if not self.__checkCardInfo(): return
        if not self.__checkSecurityInfo(): return

        capFilePath = args[0]
        try:
            self.__handler.handleLog('loadCapFile(): Start ...')
            capFileInfo = gp.readExecutableLoadFileParameters(capFilePath)
            gp.installForLoad(self.__context, self.__cardInfo,
                              self.__securityInfo, capFileInfo['loadFileAID'],
                              gp.AID_ISD, '', '', 0, 0, 0)
            gp.load(self.__context, self.__cardInfo, self.__securityInfo, '',
                    capFilePath)
            self.__handler.handleLog('loadCapFile(): Succeeded.', wx.LOG_Info)
        except Exception, e:
            self.__handler.handleException(e)
Esempio n. 3
0
 def load(self, capFilePath):
     self.__checkContext()
     self.__checkCardInfo()
     self.__checkSecurityInfo()
     gp.load(self.__context, self.__cardInfo, self.__securityInfo, "", capFilePath)
Esempio n. 4
0
        data_confirmation_counter = gp.getData(c, cc, sc, gp.TAG_CONFIRMATION_COUNTER)
        INFO_ARRAY(data_confirmation_counter, "    Data CONFIRMATION COUNTER: ")
    except:
        pass
    try:
        data_sequence_counter = gp.getData(c, cc, sc, gp.TAG_SEQUENCE_COUNTER)
        INFO_ARRAY(data_sequence_counter, "    Data SEQUENCE COUNTER: ", )
    except:
        pass
    
    packageAID = '\x11\x22\x33\x44\x55'
    moduleAID = '\x11\x22\x33\x44\x55\x00'
    appletAID = '\x11\x22\x33\x44\x55\x00'
    INFO("Delete Applet:")
    try:
        gp.deleteApplication(c, cc, sc, [packageAID]);
    except:
        pass
    
    INFO("Load CAP:")
    gp.installForLoad(c, cc, sc, packageAID, None, None, None, 0, 0, 0)
    gp.load(c, cc, sc, None, 'javacardos.cap')
    INFO("Install Applet:")
    gp.installForInstallAndMakeSelectable(c, cc, sc, packageAID, moduleAID, appletAID, 0x00, 0, 0, None, None)
    INFO("Process Applet:")
    gp.selectApplication(c, cc, appletAID);
    gp.sendApdu(c, cc, sc, '\x00\x00\x00\x00\x00')
    
    gp.disconnectCard(c, cc)
    gp.releaseContext(c)