...
...
...
...
David Banz we have a question for you in this article.
Info |
---|
This article includes updates for Smart ID Identity Manager 245.0.R11. |
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.
...
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: TODO: David Banz what does Certificate Manager SDK 8.4 mean? Should it not only be CM 8.4?
It does mean SDK. It is a set of libraries that are developed as part of CM and are used by IDM to interface with HSMs.
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 IDM 5.0.0 or later
Installed and running HSM with PKCS#11 library available on the Identity Manager server
...
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 docker deployment, edit the file docker/compose/identitymanager/config/signencrypt.xml.
Note |
---|
All Identity Manager clients that use the same database must have the same keys and certificates configured in the XML. |
Expand |
Example: Four use cases configured for HSM
The following example is an extract showing four use cases configured for HSM:
descriptor
EncryptedFields
is used for handling secrets with the Identity Manager SecretFieldStoredescriptor
ConfigZipSigner
is used for signing and verifying Identity Manager configuration zip filesdescriptor
ObjectHistorySigner
is used for signing and verifying the Identity Manager Object Historydescriptor
SignEmailDescriptor
is used for signing S/MIME mails with Mail service tasks
All four use different HSM certificates, see below in the keys
section. The example uses the Utimaco CryptoServer with Identity Manager running on Windows.
Example extract of config XML
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?>
<engineSignEncrypt>
<descriptors>
<!-- other descriptors go here... ->
<descriptor name="EncryptedFields" version="1">
<type algorithm="AES/CBC/PKCS7Padding" size="256" result="NX02" key="encryptedFieldsCertificateV1"
asymCipher="RSA/ECB/OAEPWithSHA-384AndMGF1Padding"/>
</descriptor>
<descriptor name="ConfigZipSigner" version="1">
<type algorithm="SHA-256" key="configZipSignerCertificateV1" />
</descriptor>
<descriptor name="ObjectHistorySigner" version="1">
<type algorithm="SHA-256" key="objectHistorySignerCertificateV1" />
</descriptor>
<descriptor name="SignEmailDescriptor" version="1">
<type algorithm="SHA256withRSA" key="signEmailCertificateV1"/>
</descriptor>
</descriptors>
<keys>
<!-- other keys go here... ->
<key name="encryptedFieldsCertificateV1">
<type name="HSM" locationValue="C:\Program Files\Utimaco\CryptoServer\Lib\cs_pkcs11_R2" pin.encrypted="132435"
alias="encryptedFieldsCertificateV1" slot="0" />
</key>
<key name="configZipSignerCertificateV1">
<type name="HSM" locationValue="C:\Program Files\Utimaco\CryptoServer\Lib\cs_pkcs11_R2" pin.encrypted="132435"
alias="configZipSignerCertificateV1" slot="0" />
</key>
<key name="objectHistorySignerCertificateV1">
<type name="HSM" locationValue="C:\Program Files\Utimaco\CryptoServer\Lib\cs_pkcs11_R2" pin.encrypted="132435"
alias="objectHistorySignerCertificateV1" slot="0" />
</key>
<key name="signEmailCertificateV1">
<type name="HSM" locationValue="C:\Program Files\Utimaco\CryptoServer\Lib\cs_pkcs11_R2" pin.encrypted="132435"
alias="signEmailCertificateV1" slot="0" />
</key>
</keys>
</engineSignEncrypt> |
Configuration attribute | Value | Comments |
---|---|---|
| RSA/ECB/OAEPWithSHA-384AndMGF1Padding | Must be declared so the iD2 provider accepts it:
|
...
| ||
| ||
| HSM | Must be "HSM" for keys stored in the HSM. |
|
| |
| The user PIN of the HSM. | The For |
...
docker deployments it is required to scramble the PINs before starting the Identity Manager Admin and Identity Manager Operator containers (stop them by invoking | ||
| The alias of the respective key. | In the HSM, the keypair and the certificate must be stored within the same label/alias. |
| Optional if your keys are stored in HSM slot 0. | The first slot is not guaranteed to be 0. Slot numbering may differ, depending on the HSM. |
For more information, see Sign and encrypt engine in Identity Manager for further use cases that can be configured.
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.
...
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 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)
Additional information
Expand | ||
---|---|---|
| ||