TLS offloading
Apache Tomcat
Generate key pair on the CryptoHub by using Java Keytool
7 min
this section demonstrates how to use {{ch}} to create a private key and an apache tomcat server tls certificate for use with the java keystore finally, the keytool utility will be used to list the tls certificate, confirming that the private key and certificate were successfully imported into the keystore these steps ensure that apache tomcat is configured to use the hsm backed server certificate for tls, allowing clients to verify the server during https connections perform the following tasks to create a server certificate and key pair create a new x 509 certificate container generate a new key pair for the apache tomcat tls server certificate create an approval group for the tls server certificate add an issuance policy to the tls server certificate create a certificate container perform the following steps to create a new x 509 certificate container open the {{ch}} web dashboard in a browser log in under dual control using the administrator identities select pki and ca on the left hand side > certificate management select \[ add ca ] at the bottom of the page or right click anywhere in the window and select add ca in the pop up menu, specify the following information for the certificate container name enter apache tomcat host select none type select x 509 owner group in the drop down menu, select the role automatically created for the apache tomcat service you deployed select \[ ok ] generate a key pair perform the following steps to generate a new key pair for the android apk signing client right click the x 509 certificate container you created and select add certificate > new certificate in the subject dn tab of the certificate creation wizard, select the classic preset in the drop down menu and specify futurex tomcat as the common name for the certificate in the basic info tab, select the type as ecc , select the curve as prime 256 (or higher), and select anonymous signing for security usage in the v3 extensions tab, in the profile tab, select tls server certificate select \[ ok ] to finish creating the apache tomcat tls server certificate key pair create an approval group perform the following steps to create an approval group for pki signing on the pki and ca page, select pki signing approvals at the top select \[ add approval group ] at the bottom of the page or right click anywhere in the window and select add approval group specify tomcat as the name for the approval group and select \[ ok ] right click the newly created approval group and select permission in the first drop down list, select the role automatically created for the apache tomcat service you deployed, and select \[ add ] in the permission drop down menu for the apache tomcat role, select the use permission select \[ save ] add an issuance policy perform the following steps to add an issuance policy to the android apk signing client certificate on the pki and ca page, select certificate management at the top expand the apache tomcat certificate container view by selecting the plus (+) icon next to it right click the futurex tomcat certificate and select issuance policy > add in the basic info tab, configure the following settings approvals select 0 allowed hashes select sha 256 , sha 384 , sha 512 , and sha 224 in the x 509 tab, set the default approval group to tomcat in the object signing tab, select the allow object signing checkbox select \[ ok ] to apply the issuance policy to the futurex tomcat certificate verifying the private key and certificate in the java keystore the keytool application is included in the jdk installation, so you can run the keytool command in this section with no additional configuration in a terminal of the device that will be signing apks, run the following command keytool list keystore none storetype pkcs11 providerclass sun security pkcs11 sunpkcs11 providername sunpkcs11 futurex when prompted for the keystore password, enter the identity password configured inside the \<crypto opr pass> tag in the fxpkcs11 cfg file if the command succeeds, you should see an output similar to the following keystore type pkcs11 keystore provider sunpkcs11 futurex your keystore contains 1 entry apache tomcat\ futurex tomcat\ c, privatekeyentry, certificate fingerprint (sha 256) 31 25 8e 83\ d8\ d9\ da\ a3 03 33\ e8 1b 27 29\ b8\ e4\ b4 24 18 1e 17 7c\ a0\ ce 6a 3d\ c0\ e3\ d1 97 71 0d important take note of the title (in this example, apache tomcat\ futurex tomcat\ c ) of the entry as that will be needed for the server xml file in the next section