libyubihsm
|
Libyubihsm is a library for communicating with a YubiHSM device.
To use the library include <yubihsm.h> and pass the -lyubihsm flag to the linker. Debug output is controlled with the function yh_set_verbosity().
First step of using a YubiHSM is to init the library with yh_init(), init a connector with yh_init_connector() and then connect it with yh_connect_best(). After this a session must be established with yh_create_session_derived() and yh_authenticate_session(). When a session is established commands can be exchanged over it, the functions in the namespace yh_util are high-level convenience functions that do a specific task with the device.
yubihsm.h All public functions and definitions
Here is a small example of establishing a session with a YubiHSM and fetching some random before shutting down the session.