Skip to main content

pkcs11_module/
lib.rs

1//! Raw PKCS#11 provider acquisition and ABI-layout reexports.
2//!
3//! With the default `native` feature, `function_list` and `interface_list`
4//! call provider exports without calling `C_Initialize`. Loading a provider can
5//! execute foreign code, and pointers returned by acquisition remain usable
6//! only while the provider library and its data remain valid.
7//!
8//! Without default features, this is a `no_std` wrapper around [`pkcs11_abi`]
9//! with no other dependencies. That build provides target-layout APIs;
10//! native tables, parameter declarations and acquisition require `native`.
11
12#![cfg_attr(not(feature = "native"), no_std)]
13
14#[cfg(feature = "native")]
15pub mod acquire;
16
17pub use pkcs11_abi::layout;
18#[cfg(feature = "native")]
19pub use pkcs11_abi::params;
20#[cfg(feature = "native")]
21pub use pkcs11_abi::tables;
22
23#[cfg(feature = "native")]
24pub use acquire::{RawInterface, function_list, interface_list};
25#[cfg(feature = "native")]
26pub use pkcs11_abi::{
27    CK_MU_GEN_PARAMS, CK_MU_GEN_PARAMS_PTR, CK_X9_42_MQV_DERIVE_PARAMS,
28    CK_X9_42_MQV_DERIVE_PARAMS_PTR, CKM_ML_DSA_EXTERNAL_MU, CKM_ML_DSA_EXTERNAL_MU_GEN,
29    FUNCTION_LIST_3_0_EXTRA_FIELDS, FUNCTION_LIST_3_2_EXTRA_FIELDS, FUNCTION_LIST_FIELDS, FnField,
30    Surface, TableSet, TableSpan, detect_null_functions, read_fn_pointers, tables_for,
31};
32pub use pkcs11_abi::{
33    FUNCTION_NAMES, InterfaceLayout, LayoutError, LinuxLayout, Provenance, Selection, Version,
34    function_name, function_offset, read_function_pointer, read_word_le, select, table_bytes,
35};