12 unstable releases (4 breaking)

0.5.0 Dec 19, 2025
0.4.0 Jun 3, 2025
0.3.0 Feb 17, 2025
0.2.0 Nov 14, 2024
0.1.1 Mar 31, 2021

#1481 in Cryptography

Download history 8452/week @ 2025-09-24 11165/week @ 2025-10-01 10938/week @ 2025-10-08 9514/week @ 2025-10-15 8676/week @ 2025-10-22 7798/week @ 2025-10-29 7979/week @ 2025-11-05 8159/week @ 2025-11-12 8654/week @ 2025-11-19 8906/week @ 2025-11-26 9541/week @ 2025-12-03 10749/week @ 2025-12-10 7165/week @ 2025-12-17 3423/week @ 2025-12-24 6298/week @ 2025-12-31 10354/week @ 2026-01-07

29,225 downloads per month
Used in 33 crates (2 directly)

Apache-2.0

4MB
97K SLoC

Cryptoki Rust Wrapper

Crates.io Code documentation

This is the low-level wrapper crate for PKCS #11 exposing the bindgen types.

Generating bindings

The FFI bindings presented by this crate can be either those committed in the crate under src/bindings or generated on the fly from the pkcs11.h file at build time. For generating the bindings at build time please enable the generate-bindings feature, as it is not enabled by default.

NOTE: Only a limited set of bindings are committed and their target triplet is included in the name of the file - if the triplet you require is not available, feel free to raise a Pull Request to add it or to use build-time generation of bindings. All the committed bindings MUST be generated from the library version found under the vendor submodule.

Generate bindings in container

To simplify generating bindings, we provide a simple container that ca be executed regardless of the operating system in use from the cryptoki-sys directory.

To generate the bindings in container, just build the container from the Containerfile in this directory:

$ podman build -t rust-cryptoki .

And then run it with the current working directory mounted in the container:

$ podman run -v $PWD:/src:z rust-cryptoki

It will download all the rust dependencies and regenerate all the binding tiplets.

Copyright 2021 Contributors to the Parsec project.

Dependencies