Skip to main content
Use this procedure to put a CA-signed certificate on the key pair you generated in Generate key pair on the CryptoHub by using Java Keytool, or to renew that certificate before it expires. You generate a certificate signing request (CSR) from the existing private key, have your certificate authority (CA) sign it, and import the signed certificate back to the same alias. The private key never leaves the CryptoHub, and the alias does not change, so Apache Tomcat needs no configuration change.
Renewing the certificate on the same key pair is supported. Generate a new key pair instead when your key-rotation policy requires it or when your CA no longer accepts the key size.

Before you begin

  • The key pair exists on the CryptoHub, and keytool -list shows it as a PrivateKeyEntry.
  • FXPKCS11_CFG points to your fxpkcs11.cfg in the shell where you run keytool, as described in Install and configure Futurex PKCS #11.
  • You have the signed certificate chain from your CA, or you can obtain it: the signed certificate plus every intermediate and root CA certificate.

Back up the current certificate

1
List the entries on the token and copy the exact alias of the key pair:
Shell
The entry shows as PrivateKeyEntry, with an alias in the form <alias>-<id>:<alias> (for example, futurex-tomcat-1784141140:futurex-tomcat).
2
Export the current certificate. Keep it, together with the CA chain it was issued with, so you can restore it if you need to:
Shell
current-cert.pem contains one PEM certificate.
When keytool prompts for the key store password, enter the CryptoHub identity password (PKCS #11 PIN) from the <CRYPTO-OPR-PASS> tag in fxpkcs11.cfg.

Generate a CSR from the existing key

Run the following command with the exact alias you copied. The CryptoHub signs the CSR with the existing private key; no new key is created:
Shell
openssl req -in renew.csr -noout -verify -subject reports Certificate request self-signature verify OK and shows the subject of the current certificate.
Submit renew.csr to your CA. Request the signed certificate together with its full chain, as a PKCS #7 file (.p7b) or as one PEM file that holds the signed certificate followed by each intermediate and root CA certificate.

Import the signed certificate

Import the full chain. If the file contains only the signed certificate, keytool cannot build the chain and stops with Failed to establish chain from reply. The certificate on the CryptoHub does not change when this happens.
1
Import the CA response to the same alias:
Shell
keytool prints Certificate reply was installed in keystore. If keytool asks whether to install a reply from a CA it does not trust, confirm that the root certificate in the file belongs to your CA, and then enter yes.
2
Confirm the result:
Shell
The entry keeps the same alias and is still a PrivateKeyEntry. The first certificate in the chain shows the new serial number, validity dates, and your CA as the issuer. The token holds one certificate for the alias: the import replaces the previous certificate rather than adding a second one.

Restart Apache Tomcat

Restart Tomcat with Tomcat_HOME/bin/shutdown.sh and then Tomcat_HOME/bin/startup.sh. A running Tomcat keeps serving the old certificate until it restarts, even though the CryptoHub already holds the new one. The keyAlias and certificateKeyAlias values in server.xml stay the same.

Verify it works

Connect to the HTTPS connector, for example with openssl s_client -connect <tomcat-host>:8443 -showcerts, and confirm that the server presents the new serial number and expiration date.

Troubleshooting

To roll back, import the previous certificate and its full CA chain to the same alias with the same keytool -importcert command, and then restart Apache Tomcat.
The CSR command uses SHA256withRSA for the RSA key pairs this guide generates. Futurex validated this procedure on CryptoHub 7.0.3.x with Futurex PKCS #11 (FXPKCS11) 6.0 rev dc27 and 6.5, OpenJDK 21, and an RSA 3072 key pair.