CryptoServer PKCS#11 Library and the Configuration File

The application that uses the CryptoServer PKCS#11 interface must be able to load the Utimaco PKCS#11 shared library. Furthermore, the configuration file cs_pkcs11_R2.cfg must be created and the CryptoServer PKCS#11 library must be able to find and access the file.

There are several options to tell the CryptoServer PKCS#11 library where the configuration file is located:

  • Set the environment variable CS_PKCS11_R2_CFG to the correct path and location of the configuration file by:

›_ Console

#> set CS_PKCS11_R2_CFG=”c:\My Documents\utimaco\cs_pkcs11_R2.cfg”
  • Place the configuration file in the current working directory, which is useful for development.

  • Place the configuration file in the same directory where the application is located.

  • The configuration file in a system specific directory.

The CryptoServer PKCS#11 library searches the location of the configuration file cs_pkcs11_R2.cfg in the following order:

  • First, it will be checked if the environment variable CS_PKCS11_R2_CFG is set and if it contains the name and location of the configuration file.

  • If not, it will be checked if the configuration file is located in the user’s home directory (%USERPROFILE%).

  • If not, it will be checked if the configuration file is located in the current working directory.

  • If not, it will be checked if the file is located in the same directory where the application is located.

  • If not, it will be checked if the file is located somewhere in %PATH%.

  • If not, it will be checked if the file is located in the WINDOWS directory (e.g. C:\WINDOWS).

If the CryptoServer PKCS#11 library was installed by SecurityServer, the environment variable CS_PKCS11_R2_CFG is set.

The configuration of the CryptoServer PKCS#11 library for the CryptoServer must be done within a file named cs_pkcs11_R2.cfg. This file can contain several sections, one [Global] section for general configuration one [CryptoServer] section for each CryptoServer device that should be addressed by the application and one optional [Slot] section for every slot that is in use.

Below the shortest possible configuration is listed, which is sufficient for testing purposes.

›_ Console

# sample configuration file  
[Global]  
# Select the log level (NONE...TRACE)  
Logging = 4  
# Specifies the path where the logfile shall be created.  
Logpath = C:/your_path_to_log_file  
# Defines the maximum size of the logfile. If the maximum is reached,  
# old entries will be overwritten. Can be defined as value  
# in bytes or as formatted text. E.g. value of ‘1000’ means logsize  
# is 1000 bytes whereas value of ‘1000kb’ means 1000 kilobytes.  
# Allowed formats are ‘kb’, ‘mb’ and ‘gb’.  
Logsize = 10mb  
[CryptoServer]  
# Device address to connect a CryptoServer device  
Device = 10.17.1.35