Click or drag to resize
Pdftools logo

Module Class

The PKCS#11 driver module

The PKCS#11 driver module (middleware) manages the cryptographic devices of a particular type.

Note: The PKCS#11 interface requires special handling of the driver modules:

  • In each application, the module can only be loaded once, so there can only be a single Module instance for each driver. Since this object is fully thread-safe, it might be used by multiple threads though.
  • The object must be closed before the application terminates.

Inheritance Hierarchy
SystemObject
  PdfTools.InternalNativeBase
    PdfTools.InternalNativeObject
      PdfTools.Crypto.Providers.Pkcs11Module

Namespace: PdfTools.Crypto.Providers.Pkcs11
Assembly: PdfTools (in PdfTools.dll) Version: 1.6.0+e1db8f4bf6125495a2d29513486ea3e61205c81b
Syntax
C#
public class Module : NativeObject, IDisposable

The Module type exposes the following members.

Properties
 NameDescription
Public propertyDevices

The list of devices managed by this module

Most often there is only a single device, so the method GetSingle can be used.
Public propertyEnableFullParallelization

Enable full parallelization

The PKCS#11 standard specifies that "an application can specify that it will be accessing the library concurrently from multiple threads, and the library must [...] ensure proper thread-safe behavior." However, some PKCS#11 modules (middleware) implementations are not thread-safe. For this reason, the SDK synchronizes all access to the module. If the middleware is thread-safe, full parallel usage of the cryptographic device can be enabled by setting this property to and thereby improving the performance.

Default:

Top
Methods
 NameDescription
Public methodDispose

Close all open sessions and unload the module

After unloading, the module cannot be loaded again in the same process. Proper unloading is crucial. Otherwise, the application might crash and/or the HSM, USB token, or smart card might not be unlocked.

When using the C interface, this method must not be called from the context of the destructor of a global or static object, nor an atexit() handler, nor the DllMain() entry point.

Public methodEquals
(Inherited from NativeObject)
Public methodGetHashCode
(Inherited from NativeObject)
Public methodStatic memberLoad

Load a PKCS#11 driver module

Top
See Also