Package pyhsm :: Module stick :: Class YHSM_Stick
[frames] | no frames]

Class YHSM_Stick

The current YHSM is a USB device using serial communication.

This class exposes the basic functions read, write and flush (input).

Instance Methods
 
__init__(self, device, timeout=1, debug=False)
Open YHSM device.
 
write(self, data, debug_info=None)
Write data to YHSM device.
 
read(self, num_bytes, debug_info=None)
Read a number of bytes from YubiHSM device.
 
flush(self)
Flush input buffers.
 
drain(self)
Drain input.
 
raw_device(self)
Get raw serial device.
 
set_debug(self, new)
Set debug mode (boolean).
 
__repr__(self)
 
__del__(self)
Close device when YHSM instance is destroyed.
Method Details

raw_device(self)

 

Get raw serial device. Only intended for test code/debugging!

set_debug(self, new)

 

Set debug mode (boolean).

Returns old setting.