示例#1
0
    def __installApplet(self, args):
        if not self.__checkContext(): return
        if not self.__checkCardInfo(): return
        if not self.__checkSecurityInfo(): return

        packageAID, moduleAID, appletAID, privileges, installParameters = args
        
        try:
            self.__handler.handleLog('installApplet(): Start ...')
            gp.installForInstallAndMakeSelectable(self.__context, self.__cardInfo, self.__securityInfo, packageAID, moduleAID, appletAID, privileges, 0, 0, installParameters, '')
            self.__handler.handleLog('installApplet(): Succeeded.')
        except Exception, e:
            self.__handler.handleException(e)
示例#2
0
 def installForInstallAndMakeSelectable(self, packageAID, moduleAID, appletAID, privileges, installParameters):
     self.__checkContext()
     self.__checkCardInfo()
     self.__checkSecurityInfo()
     gp.installForInstallAndMakeSelectable(
         self.__context,
         self.__cardInfo,
         self.__securityInfo,
         packageAID,
         moduleAID,
         appletAID,
         privileges,
         0,
         0,
         installParameters,
         "",
     )
示例#3
0
    def __installApplet(self, args):
        if not self.__checkContext(): return
        if not self.__checkCardInfo(): return
        if not self.__checkSecurityInfo(): return

        self.__handler.handleActionBegin("install application")

        packageAID, moduleAID, appletAID, privileges, installParameters = args

        try:
            self.__handler.handleLog('installApplet(): Start ...')
            gp.installForInstallAndMakeSelectable(self.__context,
                                                  self.__cardInfo,
                                                  self.__securityInfo,
                                                  packageAID, moduleAID,
                                                  appletAID, privileges, 0, 0,
                                                  installParameters, '')
            self.__handler.handleLog('installApplet(): Succeeded.',
                                     wx.LOG_Info)
        except Exception, e:
            self.__handler.handleException(e)
示例#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)