To use OCIcrypt with IBM CryptoExpress hardware in Enterprise PKCS #11 (EP11) mode, you must configure the hardware, install the necessary software, and register openCryptoki as a module for p11-kit. This setup allows OCIcrypt to leverage hardware security modules (HSM) via the experimental PKCS #11 protocol.
1. Hardware and OS Requirements
- Ensure you have an online
EP11-Coproc configured in the Support Element/Hardware Management Console. - On Linux on IBM Z/LinuxONE, verify hardware using
lszcrypt (from s390-tools). - Load the appropriate module if necessary:
modprobe ap. - Administrator certificates and master keys must be configured according to IBM documentation.
2. Software Installation
Install the required system packages and the EP11 host library (which must be obtained from IBM software downloads):
# Install system dependencies
apt install -y gnutls-bin opencryptoki p11-kit
# Note: You must manually download and install the EP11 host library
# (e.g., libep11 or ep11-host) using dpkg -i or rpm -i
3. Configure openCryptoki
Register openCryptoki as a module for p11-kit by creating a module file. The path to libopencryptoki.so may vary by distribution.
cat << EOF | sudo tee /etc/pkcs11/modules/opencryptoki.module
module: /usr/lib/s390x-linux-gnu/pkcs11/libopencryptoki.so
EOF
Verify the token is visible using p11tool --list-tokens. You should see an entry with Model: IBM EP11Tok.
4. Initialize the Token PIN
All tokens require a PIN. Use the URL provided by p11tool --list-tokens to initialize it:
p11tool --initialize-pin 'pkcs11:model=IBM%20EP11Tok;manufacturer=IBM%20Corp.;serial=93AAA1XX22347171;token=IBM%20OS%20PKCS%2311'
Note: The default Security Officer PIN is 87654321.
apt install -y gnutls-bin opencryptoki p11-kit
cat << EOF | sudo tee /etc/pkcs11/modules/opencryptoki.module
module: /usr/lib/s390x-linux-gnu/pkcs11/libopencryptoki.so
EOF
p11tool --initialize-pin 'pkcs11:model=IBM%20EP11Tok;manufacturer=IBM%20Corp.;serial=93AAA1XX22347171;token=IBM%20OS%20PKCS%2311'