Code Block |
---|
-legacy |
Also potentially needed, in case the legacy provider library is in the wrong path (as is the case with some OpenSSL builds for Windows) is this (make sure you locate the correct path first, instead of the examples below):
Code Block |
---|
-provider-path "C:\folder\containing\legacy.dll" |
or
Code Block |
---|
-provider-path "/folder/containing/legacy.so" |
...
Steps with installed OpenSSL for Windows
This was successfully tested with https://slproweb.com/download/Win64OpenSSL_Light-1_1_1m.msi .
- Ensure that JAVA_HOME points to the folder of the Windows Java installation that will be used by Tomcat.
- Download certsetup.zip.
- Unpack it. (For example to C:\primestuff\certsetup)
- Start a command line as administrator to execute the following:
- Navigate to the batch files (
cd c:\primestuff\certsetup
) createca.bat
trustlocalCA.bat
createP12s.bat
- Navigate to the batch files (
- Copy sign.p12 and hybridEncKeypair.p12 to WEB-INF\classes of your web applications.
Steps using WSL2
...
- Navigate to the batch files (
cd /mnt/c/primestuff/certsetup
→ depends on distribution, example is Ubuntu) ./createca.sh
./createP12s.sh
...
- Navigate to the batch files (
cd c:\primestuff\certsetup
) trustlocalCA.bat
...
Info |
---|
This article is valid for Smart ID 20.11 and above and PRIME 3.12 and above. |
In a production environment, the certificates used must be created by a real certificate authority (CA). By doing so, the trust is clear.
If it is not possible to use a CA, it is not recommended to use certificates with well-known private keys.
This article gives examples of scripts that makes it easy to set up the certificates needed with a new set of private keys. Those private keys are intended for a single machine or Identity Manager installation.
The procedure consists of these steps:
...
Create the actual P12s
By default, the names and pass phrases are used as the dummy certificates, so you just need to copy them to WEB-INF/classes in the web applications of the Identity Manager installation.
Note |
---|
In this example we only create two P12 files: one for encryption and one for signing. It is recommended to use multiple different ones for various signing-related use-cases, but the default config in supplied Tomcat packages uses a common signing P12. |
Requirements
These scripts use OpenSSL. This can be installed on Windows and added to the PATH environment variable, or you can use a WSL2 Linux distribution with OpenSSL instead.
...
The latest 1.x version of OpenSSL is recommended. Version 3 by default uses incompatible PKCS#12 algorithms.
If you insist on using version 3, then you need to change any "openssl pkcs12" calls in the .bat and .sh files from certsetup.zip to include the following extra parameter(s):
Mandatory parameter to enable the legacy provider:
new for Identity Manager 5.0.1. |
For development and test environments, test keys and certificates for all default descriptors can be generated using features of the IDM bootstrap.zip package and bootstrap docker container.
The bootstrap CA certificate generated by the procedure below will have a validity of 20 years, and each end-entity certificate will be valid for one year.
The generated PINs for every P12 file are automatically scrambled.
No keys and certificates will be generated for descriptions which absent from signencrypt.xml.
For Tomcat development or test deployment
Requirements
Tomcat not started
Tomcat folder containing unpacked IDM Operator and IDM Admin of IDM 5.0.0, or later versions, on Linux or Windows
unpacked bootstrapping.zipfor the respective IDM release
Instructions
Open a command-line window.
Change to the unpacked bootstrap folder containing create_sign_encrypt_certs.sh (linux) or create_sign_encrypt_certs.bat (windows).
Execute the respective script for your OS.
Linux:
./create_sign_encrypt_certs.sh --targetDir /PATH/TO/TOMCAT/webapps/idm-operator/WEB-INF/classes [OPTIONAL ARGS]
Windows:
create_sign_encrypt_certs.bat --targetDir C:\PATH\TO\TOMCAT\webapps\idm-operator\WEB-INF\classes [OPTIONAL ARGS]
Execute the script without any parameters to see all supported arguments (if you need the plain text passwords of the generated P12 files, then adding the passwordList argument is recommended):Code Block create_sign_encrypt_certs.bat / create_sign_encrypt_certs.sh --caDir <dir> CA cert directory - absolute or relative to bootstrapping directory (default: cacerts) --configFile <file> config to modify - absolute or relative to target directory (default: engineSignEncryptConfig.xml) --passwordList <file> optionally create file which lists unscrambled passwords - absolute or relative to target directory (will overwrite existing) --targetDir <dir> target directory for certificates - absolute or relative to current directory
Copy all P12files and engineSignEncryptConfig.xml from idm-operator/WEB-INF/classes to idm-admin/WEB-INF/classes optionally you can prune the files and XML entries which IDM Admin does not need.
For docker development or test deployment
Requirements
An unpacked SmartID package for the respective IDM release on a Linux/WSL docker host
No container started
Instructions
Open the smartid/docker/composefolder.
Prepare the files
init-smartid.env
andsmartid.env
according to the deployment documentation.
If you need the plain text passwords of the generated P12 files, then edit smartid/docker/compose/identitymanager/bootstrap/docker-compose.yml
and replacecommand: ["-configFile", "/usr/local/tools/config/signencrypt.xml", "-targetDir", "/usr/local/tools/certs"]
within the
create_sign_encrypt_certs
section withcommand: ["-configFile", "/usr/local/tools/config/signencrypt.xml", "-targetDir", "/usr/local/tools/certs", "-passwordList", "pwlist.txt"]
.
This will ensure the file smartid/docker/compose/certs/pwlist.txt will be created.
Execute the init script:
./init-smartid.sh
, which will guide you through the process, including bootstrapping.
Additional information
Expand | ||||
---|---|---|---|---|
| Bootstrap ||||