Package pyhsm :: Module cmd :: Class YHSM_Cmd
[frames] | no frames]

Class YHSM_Cmd

Known Subclasses:

Base class for YubiHSM commands.

Instance Methods
 
__init__(self, stick, command, payload='')
The base class for all YSM_ commands.
 
execute(self, read_response=True)
Write command to HSM and read response.
 
parse_result(self, data)
This function is intended to be overridden by sub-classes that implements commands that should not just return the data read from the YubiHSM.
Class Variables
  executed = False
  response_status = None
Method Details

__init__(self, stick, command, payload='')
(Constructor)

 

The base class for all YSM_ commands.

Parameters:
  • stick (pyhsm.stick.YHSM_Stick) - Reference to a YubiHSM
  • command (integer) - The YSM_xxx command defined in pyhsm.defines.
  • payload (string) - a packed C struct, represented as a Python string

execute(self, read_response=True)

 

Write command to HSM and read response.

Parameters:
  • read_response (bool) - Whether to expect a response or not.