#devices #nitrokey #search-path #low-level #communication #case #libnitrokey

sys nitrokey-sys

Low-level bindings to libnitrokey for communication with Nitrokey devices

8 stable releases

3.7.0 Apr 30, 2022
3.6.0 Sep 24, 2020
3.5.0 Jul 4, 2019
3.4.3 Jan 12, 2019
0.1.0 May 19, 2018

#1052 in Hardware support

Download history 29/week @ 2024-07-22 33/week @ 2024-07-29 31/week @ 2024-08-05 32/week @ 2024-08-12 27/week @ 2024-08-19 33/week @ 2024-08-26 30/week @ 2024-09-02 106/week @ 2024-09-09 31/week @ 2024-09-16 55/week @ 2024-09-23 24/week @ 2024-09-30 418/week @ 2024-10-07 57/week @ 2024-10-14 154/week @ 2024-10-21 52/week @ 2024-10-28 69/week @ 2024-11-04

336 downloads per month
Used in 4 crates (via nitrokey)

LGPL-3.0

160KB
3.5K SLoC

C++ 2.5K SLoC // 0.1% comments Rust 1K SLoC // 0.0% comments

nitrokey-sys-rs

Low-level Rust bindings for libnitrokey, providing access to Nitrokey devices.

This crate contains a copy of the libnitrokey library, builds it from source and links it statically. The host system must provide its dependencies in the library search path:

  • libhidapi-libusb0 (on Linux)
  • libhidapi (on non-Linux systems)

If you set the USE_SYSTEM_LIBNITROKEY environment variable when building this crate, it links directly against libnitrokey instead of building it from source. In this case, libnitrokey must be available in the library search path.

Per default, this crate uses bindings that have been generated using Rust’s x86_64-unknown-linux-gnu target. To the best of our knowledge, these bindings are platform-independent. If you want to generate the bindings, including layout tests, specifically for your platform during the build, activate the bindgen feature. In this case, you will also need clang and libclang in the default search path.

Alternatively, you can execute make verify-bindings to compare the pre-generated bindings with the bindings that bindgen generates for your platform. This check only works on a clean Git working tree and requires the bindgen binary, git and quilt.

Versioning

The major and minor version of the nitrokey-sys crate map to the major and minor version of libnitrokey. The nitrokey-sys patch version may be increased independently.

Contributing

Contributions to this project are welcome! Please submit patches to the mailing list ~ireas/nitrokey-rs-dev@lists.sr.ht (archive) using the [PATCH nitrokey-sys-rs] subject prefix. For more information, see the Contributing Guide.

Contact

For bug reports, patches, feature requests or other messages, please send a mail to the mailing list ~ireas/nitrokey-rs-dev@lists.sr.ht (archive).

License

This project as well as libnitrokey are licensed under the LGPL-3.0.

Dependencies

~0–385KB