Changeset 183

Show
Ignore:
Timestamp:
01/28/10 17:35:16 (1 month ago)
Author:
lrousseau
Message:

Print the header before calling the PKCS#11 function to identify in
which method the exception occurred (if any)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pykcs11/trunk/samples/getinfo.py

    r180 r183  
    3838 
    3939    def getSlotInfo(self, slot): 
     40        print "Slot n.:", slot 
    4041        i = self.pkcs11.getSlotInfo(slot) 
    41         print "Slot n.:", slot 
    4242        self.colorize("  slotDescription:", i.slotDescription.strip()) 
    4343        self.colorize("  manufacturerID:", i.manufacturerID.strip()) 
     
    4747 
    4848    def getTokenInfo(self, slot): 
     49        print " TokenInfo" 
    4950        t = self.pkcs11.getTokenInfo(slot) 
    50         print " TokenInfo" 
    5151        self.colorize("  label:", t.label.strip()) 
    5252        self.colorize("  manufacturerID:", t.manufacturerID.strip()) 
     
    6969 
    7070    def getMechanismInfo(self, slot): 
     71        print "  Mechanism list: " 
    7172        m = self.pkcs11.getMechanismList(slot) 
    72         print "  Mechanism list: " 
    7373        for x in m: 
    7474            self.colorize("  ", x) 
     
    9191 
    9292    def getSessionInfo(self, slot, pin=None): 
     93        print " SessionInfo" 
    9394        session = self.pkcs11.openSession(slot) 
    9495        s = session.getSessionInfo() 
     
    9899            session.login(pin) 
    99100 
    100         print " SessionInfo" 
    101101        self.colorize("  slotID:", s.slotID) 
    102102        self.colorize("  state:", s.state2text()) 
(C) 2006 bit4id srl, for informations please contact info@bit4id.com
visitors since August 21, 2006