Libyubihsm

Libyubihsm is the C library used to communicate natively with a YubiHSM 2. It implements and exposes convenience functions for all the commands supported by the device. It also allows to send unformatted "raw" messages over an established session or in plain-text.

The library is used by yubihsm-shell, the PKCS#11 module and the KSP.

Documentation of the library API can be found as comments within the header file (yubihsm.h) in the SDK, or as a pre-built Doxygen bundle.

Backends

Libyubihsm requires a Connector component to talk to a YubiHSM device. This component can be one of two different types.

HTTP Connector

This kind of Connector is a multiplexer daemon that speaks USB towards a YubiHSM device and HTTP towards libyubihsm. This is the component described as yubihsm-connector.

In order to select this type of backend the connector URL should use the http or https scheme. For example to use a local HTTP Connector use http://127.0.0.1:12345.

USB Connector

This kind of Connector is a direct-access USB backend that talks directly with a YubiHSM device. The USB Connector is built-in into libyubihsm. This allows to not have to run an additional component (i.e., the external Connector) at the cost of requiring exclusive access to a YubiHSM device.

In order to select this type of backend the connector URL should use the yhusb scheme. For example to use a local device with serial number 123456 use yhusb://serial=123456.