Beispiel #1
0
    def __getStatus(self, args):
        if not self.__checkContext(): return
        if not self.__checkCardInfo(): return
        if not self.__checkSecurityInfo(): return

        self.__handler.handleActionBegin("get status")
        try:
            self.__handler.handleLog('getStatus: Start ...')
            status80 = None
            status40 = None
            status20 = None
            status10 = None
            try:
                status80 = gp.getStatus(self.__context, self.__cardInfo,
                                        self.__securityInfo, 0x80)
            except Exception, e:
                self.__handler.handleLog('GetStatus(0x80): ' + e.message,
                                         wx.LOG_Error)
                pass
            try:
                status40 = gp.getStatus(self.__context, self.__cardInfo,
                                        self.__securityInfo, 0x40)
            except Exception, e:
                self.__handler.handleLog('GetStatus(0x40): ' + e.message,
                                         wx.LOG_Error)
                pass
    def __getStatus(self, args):
        if not self.__checkContext(): return
        if not self.__checkCardInfo(): return
        if not self.__checkSecurityInfo(): return

        try:
            self.__handler.handleLog('getStatus: Start ...')
            status80 = None
            status40 = None
            status20 = None
            status10 = None
            try:
                status80 = gp.getStatus(self.__context, self.__cardInfo, self.__securityInfo, 0x80)
            except Exception, e:
                self.__handler.handleLog('GetStatus(0x80): ' + e.message)
                pass
            try:
                status40 = gp.getStatus(self.__context, self.__cardInfo, self.__securityInfo, 0x40)
            except Exception, e:
                self.__handler.handleLog('GetStatus(0x40): ' + e.message)
                pass
         status80 = None
         status40 = None
         status20 = None
         status10 = None
         try:
             status80 = gp.getStatus(self.__context, self.__cardInfo, self.__securityInfo, 0x80)
         except Exception, e:
             self.__handler.handleLog('GetStatus(0x80): ' + e.message, wx.LOG_Error)
             pass
         try:
             status40 = gp.getStatus(self.__context, self.__cardInfo, self.__securityInfo, 0x40)
         except Exception, e:
             self.__handler.handleLog('GetStatus(0x40): ' + e.message, wx.LOG_Error)
             pass
         try:
             status20 = gp.getStatus(self.__context, self.__cardInfo, self.__securityInfo, 0x20)
         except Exception, e:
             self.__handler.handleLog('GetStatus(0x20): ' + e.message, wx.LOG_Error)
             pass
         try:
             status10 = gp.getStatus(self.__context, self.__cardInfo, self.__securityInfo, 0x10)
         except Exception, e:
             self.__handler.handleLog('GetStatus(0x10): ' + e.message, wx.LOG_Error)
             pass
         self.__handler.handleStatus({ 0x80 : status80, 0x40 : status40, 0x20 : status20, 0x10 : status10})
         self.__handler.handleLog('getStatus: succeeded.', wx.LOG_Info)
     except Exception, e:
         self.__handler.handleException(e)
     self.__handler.handleActionEnd("get status")
 
 def getStatus(self):
Beispiel #4
0
 def getStatus(self, cardElement):
     self.__checkContext()
     self.__checkCardInfo()
     self.__checkSecurityInfo()
     return gp.getStatus(self.__context, self.__cardInfo, self.__securityInfo, cardElement)
Beispiel #5
0
 try:
     status80 = gp.getStatus(self.__context, self.__cardInfo,
                             self.__securityInfo, 0x80)
 except Exception, e:
     self.__handler.handleLog('GetStatus(0x80): ' + e.message,
                              wx.LOG_Error)
     pass
 try:
     status40 = gp.getStatus(self.__context, self.__cardInfo,
                             self.__securityInfo, 0x40)
 except Exception, e:
     self.__handler.handleLog('GetStatus(0x40): ' + e.message,
                              wx.LOG_Error)
     pass
 try:
     status20 = gp.getStatus(self.__context, self.__cardInfo,
                             self.__securityInfo, 0x20)
 except Exception, e:
     self.__handler.handleLog('GetStatus(0x20): ' + e.message,
                              wx.LOG_Error)
     pass
 try:
     status10 = gp.getStatus(self.__context, self.__cardInfo,
                             self.__securityInfo, 0x10)
 except Exception, e:
     self.__handler.handleLog('GetStatus(0x10): ' + e.message,
                              wx.LOG_Error)
     pass
 self.__handler.handleStatus({
     0x80: status80,
     0x40: status40,
     0x20: status20,
Beispiel #6
0
 
 c = gp.establishContext()
 
 readernames = gp.listReaders(c)
 for i in range(len(readernames)):
     print('%d - %s' %(i, readernames[i]))
 i = int(input("Please select one reader: "))
 cc = gp.connectCard(c, readernames[i], gp.SCARD_PROTOCOL_T1)
 
 gp.sendApdu(c, cc, None, '\x00\xB0\x00\x00\x00')
 gp.selectApplication(c, cc, '')
 sc = gp.mutualAuthentication(c, cc, gp.DEFAULT_KEY, gp.DEFAULT_KEY, gp.DEFAULT_KEY, gp.DEFAULT_KEY, 0x00, 0x00, 0x02, 0x15, 0, 0)
 
 INFO("Get status:")
 try:
     status10 = gp.getStatus(c, cc, None, gp.GET_STATUS_P1_EXECUTABLE_LOAD_FILES_MODULES)
     INFO("    Status 0x10: " + str(status10))
 except:
     pass
 try:
     status20 = gp.getStatus(c, cc, None, gp.GET_STATUS_P1_EXECUTABLE_LOAD_FILES)
     INFO("    Status 0x20: " + str(status20))
 except:
     pass
 try:
     status40 = gp.getStatus(c, cc, None, gp.GET_STATUS_P1_APP_SSD)
     INFO("    Status 0x40: " + str(status40))
 except:
     pass
 try:
     status80 = gp.getStatus(c, cc, None, gp.GET_STATUS_P1_ISD)