Install and Configure Libp11

  1. Download and install OpenSSL 3 if not installed, refer to https://slproweb.com/products/Win32OpenSSL.html for windows build. Here OpenSSL is installed in C:\OpenSSL-Win64.

  2. Download libp11 from https://github.com/OpenSC/libp11/releases.

  3. Download and Install Visual Studio, refer to https://visualstudio.microsoft.com/vs/older-downloads/.

  4. Open the Native x64 VS Command Prompt and go to the directory where libp11 is extracted.

  5. Run the following command to build and install libp11 with openssl.

›_ Console

nmake /f Makefile.mak OPENSSL_DIR=c:\OpenSSL-Win64 BUILD_FOR=WIN64 
image-3285844118-1.jpg

Output of nmake command

image-3285844118-2.jpg

Output of nmake command

  1. Verify pkcs11.dll is available inside <libp11>/src/ folder.

  2. Edit openssl.cnf from C:\Program Files\Common Files\SSL\openssl.cnf and add the following line in the first line of the file.

openssl.cnf

openssl_conf = openssl_init  
  1. Enter the following lines under last section of openssl.cnf file.

openssl.cnf

[openssl_init]  
engines=engine_section  
[engine_section]  
pkcs11 = pkcs11_section  
[pkcs11_section]  
engine_id = pkcs11  
dynamic_path = C:\\Users\\openssl-user\\Downloads\\libp11-  
0.4.12\\src\\pkcs11.dll  
MODULE_PATH = C:\\Program   
Files\\Utimaco\\SecurityServer\\Lib\\cs_pkcs11_R3.dll  
init = 0  

Dynamic path and Module path will get changed according to the user environment.

  1. Run the command below to verify if the OpenSSL Engine is available or not.

›_ Console

# openssl engine pkcs11 -t 
image-3285844118-3.jpg

Verification of pkcs11 engine