Comment: 24.R1 - updated use cases and other information across the article.
Remember to update the release version number before publishing externally.
This article includes updates for Smart ID Identity Manager 24.R1.
Keys and certificates for the sign and encrypt engine can be stored in a Hardware Security Model (HSM) for several use cases. This is a more secure solution for signing and encryption than PKCS#12 files, which are files in the file system, only protected by a PIN code.
The following use cases support storing the keys in an HSM:
Encryption and decryption of fields in the Identity Manager database (descriptor: encryptedFields)
Signing and verification of the object history (descriptor: objectHistorySigner)
Signing and validation of the configuration files (descriptor: configZipSigner)
Encryption of the configuration files (descriptor: configZipEncrypter)
Signing of emails (descriptor: signEmailDescriptor)
Creation of JWS signatures used for Smart ID messaging content provider API (descriptor: ContentProviderJWSSigner)
Authentication of Smart ID Self-Service users to the Identity Manager backend (descriptor: SelfServiceJWTSigner)
Decryption of PIN blobs from pre-personalized smart-cards created with the Personal Desktop Client (arbitrarily named descriptors)
Attestation for provisioning to Smart ID Mobile / Desktop Apps (descriptors: att_*)
Different set of JAR files for Identity Manager in Smart ID 21.10 and later
Certificate Manager SDK 8.4 and later (as used in Identity Manager 21.10 and later) has a different set of JAR files compared to previous versions:
cmcommon-x.y.z.jar => renamed to cm-common-x.y.z.jar
cmsdk-x.y.z.jar => renamed to cm-sdk-x.y.z.jar
csp-x.y.z.jar => removed, all code moved to common-x.y.z.jar
common-x.y.z.jar => now includes csp code as well and carries JCE provider signature
For more information, see Configure Tomcat below.
Prerequisites
Installed Smart ID 24.R1 or later
Installed and running HSM with PKCS#11 library available on the Identity Manager server
Step-by-step instructions
Prepare and install HSM
Install the HSM PKCS#11 middleware on the Identity Manager server.
The PKCS#11 DLL/.so file will later be referenced in the Identity Manager configuration.Install or create a signing and encryption certificate on the HSM as needed, this depends on your use cases. Alias, slot, and PIN will be required in the configuration to access the certificates.
Configure Identity Manager
Install the PKCS#11 bridge DLL
Identity Manager requires a native bridge DLL for the access to the HSM's PKCS#11 library, jpkcs11.dll / libjpkcs11.so
The library is provided with your Identity Manager package or on request.
The library exists as 32 bit and 64 bit version. Use the 64 bit version with Identity Manager.
Tomcat deployment on Windows
The library must be available in the PATH environment variable.
Create a new folder for it and add the folder to the PATH or copy it to your C:\Windows\System32 folder.
Docker deployment
For docker deployment, libjpkcs11 must be placed onto the docker host and then mounted into the respective containers.
Add a volume mount to docker/compose/identitymanager/admin/docker-compose.yml and docker/compose/identitymanager/operator/docker-compose.yml. In the example below, libjpkcs11_x64-3.6.3.1.so (version number may vary) is placed into the docker/compose/identitymanager/config/ folder, which is then mounted into the container’s Tomcat folder for native libs as libjpkcs11.so.
volumes: - "../config/libjpkcs11_x64-3.6.3.1.so:/usr/local/tomcat/native-jni-lib/libjpkcs11.so:ro"
Configure engineSignEncryptConfig.xml/signencrypt.xml
Perform the Identity Manager HSM configuration in the file engineSignEncryptConfig.xml in the WEB-INF/classes folder for each of the relevant Identity Manager clients. In case of Docker deployment, edit the file docker/compose/identitymanager/config/signencrypt.xml.
All Identity Manager clients that use the same database must have the same keys and certificates configured in the XML.
Configure Tomcat
There is an issue with the iD2 security provider when you have two or more web clients, for example Identity Manager Operator and Identity Manager Admin, deployed in the same Tomcat that uses it to load a PKCS#11 keystore from the HSM.
If you do not handle this, errors like this can occur:
Caused by: java.lang.IllegalArgumentException: Parameter must be of type com.id2tech.security.store.Pkcs11LoadStoreParameters but is com.id2tech.security.store.Pkcs11LoadStoreParameters
In addition, you may get a ClassNotFoundException for various BouncyCastle classes in crypto-related use-cases like soft token requests, for example:Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
To avoid this, deploy each Identity Manager web app on its own dedicated Tomcat instance (Docker deployments always work like this) or remove all CMSDK JARs and all BouncyCastle JARs from all webapps' tomcat\<webapp>\WEB-INF\lib folders and place them in tomcat\libs instead. This ensures that the JARs are served from the Tomcat common classloader for all web apps.
CMSDK JARs:
cmcommon*.jar
cmsdk-*.jar
common-*.jar
BouncyCastle JARs:
bcmail-*.jar
bcpgp-*.jar
bcpkix-*.jar
bcprov-*.jar (including bcprov-ext-*.jar)