Select the KeyStore creation method
You can create and populate the KeyStore file with one of the following methods:
- Using the
HUCRYPTJCLThis method is a wrapper around the z/OS UNIX command-line method that incorporates variable definitions and script invocation into a single JCL.
HUHCRYPTis located inHUH.#CUST.JCL, unless you specified a different location when you customized and submitted theHUH.SHUHSAMP(HUHSETUP)job. For more details, see Customization setup. - Using the z/OS UNIX command lineThis method does not have the line-length limitations that JCL has. But you need to do the following steps:
- Copy and customize the
rseapi.certificate.envfile.The
rseapi.certificate.envfile resides in the/usr/lpp/IBM/rseapi/samplesdirectory, unless you used a different path during the SMP/E installation of RSE API. - From the directory that holds the customized
rseapi.certificate.env, invoke the/usr/lpp/IBM/rseapi/tomcat.base/bin/huhcrypto.shscript. The exact script location depends on the path that is used during the SMP/E installation of RSE API.
- Copy and customize the
- Using an existing server certificate that resides in your security databaseThis method does not invoke the script that creates a new certificate and allows you to use an existing certificate. Issue the following commands on the z/OS UNIX command line to store the certificate and related Certificate Authority (CA) certificate in a KeyStore file:
- Issue TSO OMVS to get to the z/OS UNIX command line.
- Export the server and CA certificates from your security database to sequential data sets. These
sample commands assume you are using RACF as security
manager.
tso "RACDCERT CERTAUTH EXPORT(LABEL('#rseapi')) FORMAT(PKCS12DER) PASSWORD('#mypassword') DSN('MY.RACF.SIGNED.RSEAPI.CERT.P12')" tso "RACDCERT CERTAUTH EXPORT(LABEL('#ca.label')) FORMAT(CERTB64) DSN('MY.RACF.PUBLIC.CA.CERT.B64')" - Go to the directory that will hold the KeyStore (the directory is created by the
HUHSETUPJCL described in Customization setup).cd /etc/zexpl/rseapi_crypto - Copy the exported server certificate to this directory as a (PKCS12) KeyStore
file.
cp "//'MY.RACF.SIGNED.RSEAPI.CERT.P12'" keystore - Add the CA certificate to the KeyStore
file.
cp "//'MY.RACF.PUBLIC.CA.CERT.B64'" ca.crt keytool -importcert -trustcacerts -noprompt -alias #ca.label -keystore keystore -storetype PKCS12 -storepass #mypassword -file ca.crt - Verify the
result.
keytool -list -keystore keystore -storepass #mypassword -storetype PKCS12
With these steps completed, you can skip straight to the Customize rseapi.env section, and use these values for the RSEAPI_KEYSTORE_* variables:RSEAPI_KEYSTORE_FILE=$RSEAPI_CFG/rseapi_crypto/keystore RSEAPI_KEYSTORE_PASS=#mypassword RSEAPI_KEYSTORE_TYPE=PKCS12