Example #1
0
 def calculate(self, credential, timestamp, password_key):
     try:
         dev = self._descriptor.open_device(TRANSPORT.CCID)
         controller = OathController(dev.driver)
         if controller.locked and password_key is not None:
             controller.validate(a2b_hex(password_key))
     except:
         return None
     return controller.calculate(Credential.from_dict(credential),
                                 timestamp).to_dict()
Example #2
0
 def calculate(self, credential, timestamp, password_key):
     return self._calculate(Credential.from_dict(credential), timestamp,
                            password_key).to_dict()
Example #3
0
 def delete_credential(self, credential, password_key):
     dev = self._descriptor.open_device(TRANSPORT.CCID)
     controller = OathController(dev.driver)
     if controller.locked and password_key is not None:
         controller.validate(a2b_hex(password_key))
     controller.delete(Credential.from_dict(credential))