Skip to content

Commit

Permalink
Merge branch 'staging' into fingerprint-upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Winchester authored Aug 10, 2020
2 parents 8b9a157 + 0f70e43 commit 93c704d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/apiml_cm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,22 @@ function export_jwt_from_keyring {

function zosmf_jwt_public_key {
echo "Retrieves z/OSMF JWT public key and stores it to ${SERVICE_KEYSTORE}.${JWT_ALIAS}.pem"

# If Zowe local CA keystore file does not exist (e.g. is defined in a keyring) then we have to create another CA
# whose sole purpose is to help forging a fake certificate that encapsulates JWT token from z/OSMF so that it can be
# connected with PKCS11 token.
if [[ ! -f ${LOCAL_CA_FILENAME}.keystore.p12 ]]; then
echo "Generate keystore with the CA private key and CA public certificate:"
pkeytool -genkeypair $V -alias ${LOCAL_CA_ALIAS} -keyalg RSA -keysize 2048 -keystore ${LOCAL_CA_FILENAME}.keystore.p12 \
-dname "${LOCAL_CA_DNAME}" -keypass ${LOCAL_CA_PASSWORD} -storepass ${LOCAL_CA_PASSWORD} -storetype PKCS12 -validity ${LOCAL_CA_VALIDITY} \
-ext KeyUsage="keyCertSign" -ext BasicConstraints:"critical=ca:true"
chmod 600 ${LOCAL_CA_FILENAME}.keystore.p12

echo "Export the CA public certificate:"
pkeytool -export $V -alias ${LOCAL_CA_ALIAS} -file ${LOCAL_CA_FILENAME}.cer -keystore ${LOCAL_CA_FILENAME}.keystore.p12 -rfc \
-keypass ${LOCAL_CA_PASSWORD} -storepass ${LOCAL_CA_PASSWORD} -storetype PKCS12
fi

java -Xms16m -Xmx32m -Xquickstart \
-Dfile.encoding=UTF-8 \
-Djava.io.tmpdir=${TEMP_DIR} \
Expand Down

0 comments on commit 93c704d

Please sign in to comment.