Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyring support #1177

Merged
merged 56 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
42f689f
keyring support using keytool utility
vit-tomica Feb 19, 2020
04624d7
do not make keyring as default yet
vit-tomica Feb 21, 2020
4e81671
added keyring-util function for keyring operations
vit-tomica Mar 3, 2020
0e14104
Merge remote-tracking branch 'origin/staging' into keyring-support
vit-tomica Mar 3, 2020
c0e71a1
add informational message
vit-tomica Mar 3, 2020
a111842
keyring cleanup; zosmf trust
vit-tomica Mar 4, 2020
67ec8d6
zosmf trust
vit-tomica Mar 4, 2020
f8c2086
Merge branch 'staging' into keyring-support
OnnoVdT Mar 4, 2020
f55ea2a
adding umask in zowe-setup-certificates.sh; minor changes
vit-tomica Mar 5, 2020
fb54bae
Merge remote-tracking branch 'origin/keyring-support' into keyring-su…
vit-tomica Mar 5, 2020
990380e
typo
vit-tomica Mar 6, 2020
f1bf272
Merge branch 'staging' into keyring-support
OnnoVdT Mar 20, 2020
e39d38a
Merge remote-tracking branch 'origin/staging' into keyring-support
vit-tomica Apr 22, 2020
db57265
Merge branch 'staging' into keyring-support
1000TurquoisePogs Apr 28, 2020
01699ce
use four slashes so java components can directly consume the value
vit-tomica May 4, 2020
223d832
Merge remote-tracking branch 'origin/keyring-support' into keyring-su…
vit-tomica May 4, 2020
275b1a5
added JCL that configures certificates and SAF keyrings
vit-tomica May 6, 2020
3eb1423
Added ZWEKRING element to SMPE build
vit-tomica May 6, 2020
3111902
Do not build keyring-util program. Ship pre-built binaries instead.
vit-tomica May 7, 2020
024520a
Do not export private key and cert when using a keyring
vit-tomica May 7, 2020
26d77f6
Do not generate certificates for keyring if ZWEKRING jcl already did
vit-tomica May 7, 2020
33b714c
Merge branch 'staging' into keyring-support
vit-tomica May 7, 2020
04a975e
Remove KEYSTORE_KEY,KEYSTORE_CERTIFICATE,KEYSTORE_CERTIFICATE_AUTHORI…
vit-tomica May 7, 2020
7a8ce6f
Merge remote-tracking branch 'origin/keyring-support' into keyring-su…
vit-tomica May 7, 2020
7164302
added 'chmod +x' for keyring_util; fix iconv
vit-tomica May 7, 2020
11315da
add descriptions
vit-tomica May 12, 2020
9f56c88
Merge remote-tracking branch 'origin/staging' into keyring-support
vit-tomica May 12, 2020
38779cb
Always set up trust with zosmf because of retrieving JWT token from z…
vit-tomica May 14, 2020
31c2517
ZWEKRING - remove blank between SET LABEL= and a value
vit-tomica May 15, 2020
61fa7a7
create SET variables for signing CA's
vit-tomica May 19, 2020
49d6369
Added ACF2 commands
vit-tomica May 22, 2020
ab3b730
ACF2 fixes
vit-tomica May 25, 2020
45723c7
Allow Zowe to use certificate owned by SITE acid
vit-tomica May 25, 2020
3d1032e
Add KEYRING_OWNER and KEYRING_NAME variables to the zowe-certificates…
vit-tomica May 26, 2020
29201e4
minor change
vit-tomica May 28, 2020
6be2277
escape dollar sign
vit-tomica Jun 4, 2020
e4413cb
Use only handshake key usage for generated certificate
vit-tomica Jun 5, 2020
2bae8d2
Export a zowe generated jwt public key from a keyring
vit-tomica Jun 8, 2020
412d1d4
Hardcode the password value otherwise JVM fails reading the keyring
vit-tomica Jun 9, 2020
7f5268b
Merge remote-tracking branch 'origin/staging' into keyring-support
vit-tomica Jun 19, 2020
fd72a91
increase zlux version
vit-tomica Jun 19, 2020
77097ee
Merge remote-tracking branch 'origin/staging' into keyring-support
vit-tomica Jun 19, 2020
5d3cc8e
remove apostrophes from ALTNAME keyword for ACF2
vit-tomica Jun 22, 2020
382bf74
Detect root CA for a certificate in a key ring
vit-tomica Jun 22, 2020
bda18ea
add keyring to artifactory build (#1453)
MarkAckert Jun 24, 2020
d35753c
remove backtick
vit-tomica Jun 24, 2020
955b65d
update keyring utilities version to 1.0.2
vit-tomica Jul 7, 2020
279813e
Merge remote-tracking branch 'origin/staging' into keyring-support
vit-tomica Jul 7, 2020
249ce27
update keyring utilities version to 1.0.3
vit-tomica Jul 8, 2020
10fd8ec
Merge remote-tracking branch 'origin/staging' into keyring-support
vit-tomica Jul 8, 2020
f7c4c66
Merge branch 'staging' into keyring-support
stevenhorsman Jul 13, 2020
4f559f6
resolve PR review comments
vit-tomica Jul 20, 2020
806c396
Merge remote-tracking branch 'origin/keyring-support' into keyring-su…
vit-tomica Jul 20, 2020
3b89914
Merge branch 'staging' into keyring-support
vit-tomica Jul 20, 2020
b26f68d
Merge branch 'staging' into keyring-support
OnnoVdT Jul 24, 2020
81c97dd
Merge branch 'staging' into keyring-support
stevenhorsman Jul 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 167 additions & 48 deletions bin/apiml_cm.sh

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions bin/utils/keyring-util/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
The keyring-util's source code can be found in the
https://github.com/zowe/keyring-utilities

# keyring-util

The keyring-util program leverages
[R_datalib callable service](https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.ichd100/datalib.htm)
to perform various operations on digital certificates and RACF key rings.

## Build
Execute the `build.sh` script

## Syntax
```bash
keyring-util function userid keyring label
```
**Parametres:**
1. `function` see [Functions](##Functions) section below
2. `userid` - an owner of the `keyring` and `label` certificate
3. `keyring` - a name of the keyring
4. `label` - a label of the certificate
5. `extra-parm-1` - specific to a used function
6. `extra-parm-2` - specific to a used function

## Functions

* `NEWRING` - creates a keyring
* Example: `keyring-util NEWRING USER01 RING02`

* `DELRING` - deletes a keyring
* Example: `keyring-util DELRING USER01 RING02`

* `DELCERT` - remove a certificate from a keyring or deletes a certificate from RACF database

**Current Limitation:** The `DELCERT` function can only manipulate a certificate that is owned by the `userid`, i.e. it can't
work with certificates owned by the CERTAUTH, SITE or different userid.

The following example removes `CERT03` certificate owned by the `USER01` from the `RING02` keyring owned by the `USER01` userid
* Example: `keyring-util DELCERT USER01 RING02 CERT03`

The following example removes `CERT03` certificate owned by the `USER01` from the RACF database. The command fails if the certificate
is still connected to some keyring.
* Example: `keyring-util DELCERT USER01 '*' CERT03`

* `EXPORT` - exports a certificate in PEM format. The file is created in a `pwd` directory with a name of `<cert_alias>.pem`
* Example: `keyring-util EXPORT USER01 RING02 CERT03`

Creates a file CERT03.pem.

* `IMPORT` - imports a certificate from the PKCS12 format.

**Warning:** The scenario where a private key is also imported currently works only with RACF.

* Example: `keyring-util IMPORT USER01 RING02 CERT03 /path/to/file.p12 pkcs12_password`

* `REFRESH` - refreshes DIGTCERT class
* Example: `keyring-util REFRESH`

For any return and reason codes, check [R_datalib return and reason codes](https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.ichd100/ich2d100238.htm)

## Further development
There is room for improvement:
* command line argument processing and syntax (perhaps using the argp library from [ambitus project](https://github.com/ambitus/glibc/tree/zos/2.28/master/argp))
* an extension of functionality of the current R_datalib functions
* adding support for other [R_datalib functions](https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.ichd100/ich2d100226.htm)

Work with the following resource if you want to add support for other R_datalib functions [Data areas for R_datalib callable service](https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.ichc400/comx.htm)


Binary file added bin/utils/keyring-util/keyring-util
Binary file not shown.
30 changes: 22 additions & 8 deletions bin/zowe-setup-certificates.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Zowe development: if you edit this file, please make sure to update the
# ../workflows/ZWEWRF05.xml file accordingly.

# The hostname of the system running API Mediation. If the hostname is
# The hostname of the system running API Mediation. If the hostname is
# omitted, the configuration script attempts to calculate the value on
# its own.
HOSTNAME=
Expand All @@ -13,15 +13,18 @@ IPADDRESS=
VERIFY_CERTIFICATES=true

# optional - Path to a PKCS12 keystore with a server certificate for API
# Mediaton Layer (APIML)
# Mediaton Layer (APIML). Ignore if you used the ZWEKRING jcl
EXTERNAL_CERTIFICATE=
# optional - Alias of the certificate in the keystore
# optional - Alias of the certificate in the keystore. Ignore if you used
# the ZWEKRING jcl
EXTERNAL_CERTIFICATE_ALIAS=
# optional - Public certificates of trusted CAs - multiple certificates
# delimitad with space has to be enclosed with quotes ("cer1 cer2")
# Ignore if you used the ZWEKRING jcl
EXTERNAL_CERTIFICATE_AUTHORITIES=
# optional - Public certificates of z/OSMF - multiple certificates
# delimited with space has to be enclosed with quotes ("cer1 cer2")
# Ignore if you used the ZWEKRING jcl
ZOSMF_CERTIFICATE=
# If APIML SSO token not present, Zowe components are allowed to attempt authentication with other user-provided data
SSO_FALLBACK_TO_NATIVE_AUTH=true
Expand All @@ -32,13 +35,24 @@ PKCS11_TOKEN_LABEL=

# Select a password that is used to secure EXTERNAL_CERTIFICATE keystore
# and that will be also used to secure newly generated keystores for API
# Mediation
# Mediation. Ignore if you used the ZWEKRING jcl
KEYSTORE_PASSWORD=password
# Location for generated certificates
# Location for generated certificates and/or JWT token
KEYSTORE_DIRECTORY=/global/zowe/keystore
# Select an alias for the certificate in the generated keystore
# Select an alias for the certificate in the generated keystore.
# If you used the ZWEKRING jcl, then this variable has to be set to the
# Zowe certificate's LABEL specified in the JCL.
KEYSTORE_ALIAS=localhost
# Specify zowe user id to set up ownership of the generated certificates
# Specify zowe user id to set up ownership of the generated certificates.
# This variable is also used for keyring configuration. If you used
# the ZWEKRING jcl, set the variable to the same user id as in the jcl.
ZOWE_USER_ID=ZWESVUSR
# Specify zowe user id to set up ownership of the generated certificates
# Specify zowe group id to set up ownership of the generated certificates
ZOWE_GROUP_ID=ZWEADMIN
# Specify zowe keyring that keeps zowe certificates, if not specified then
# USS keystore files will be created. If you used the ZWEKRING jcl, set
# the variable to the same keyring that you used in the jcl.
ZOWE_KEYRING=
# If you used ZWEKRING jcl to configure the certificates for the keyring
# then set this variable to false (defaults to false)
GENERATE_CERTS_FOR_KEYRING=false
109 changes: 81 additions & 28 deletions bin/zowe-setup-certificates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# - KEYSTORE_PASSWORD - a password that is used to secure EXTERNAL_CERTIFICATE keystore and
# that will be also used to secure newly generated keystores for API Mediation.
# - ZOWE_USER_ID - zowe user id to set up ownership of the generated certificates
# - ZOWE_KEYRING - specify zowe keyring that keeps zowe certificates, if not specified USS keystore
# files will be created.
# - GENERATE_CERTS_FOR_KEYRING - If you used ZWEKRING jcl to configure certificates and the keyring
# then set this variable to false (defaults to false)

# process input parameters.
while getopts "l:p:" opt; do
Expand All @@ -27,6 +31,8 @@ while getopts "l:p:" opt; do
done
shift $(($OPTIND-1))

umask 0027

if [[ -z ${ZOWE_ROOT_DIR} ]]
then
export ZOWE_ROOT_DIR=$(cd $(dirname $0)/../;pwd)
Expand Down Expand Up @@ -96,15 +102,25 @@ SAN="SAN=dns:${ZOWE_EXPLORER_HOST},ip:${ZOWE_IP_ADDRESS},dns:localhost.localdoma

if [[ -z "${EXTERNAL_CERTIFICATE}" ]] || [[ -z "${EXTERNAL_CERTIFICATE_ALIAS}" ]] || [[ -z "${EXTERNAL_CERTIFICATE_AUTHORITIES}" ]]; then
if [[ -z "${EXTERNAL_CERTIFICATE}" ]] && [[ -z "${EXTERNAL_CERTIFICATE_ALIAS}" ]] && [[ -z "${EXTERNAL_CERTIFICATE_AUTHORITIES}" ]]; then
${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action setup --service-ext ${SAN} --service-password ${KEYSTORE_PASSWORD} \
--service-alias ${KEYSTORE_ALIAS} --service-keystore ${KEYSTORE_PREFIX} --service-truststore ${TRUSTSTORE_PREFIX} --local-ca-filename ${LOCAL_CA_PREFIX}
RC=$?
echo "apiml_cm.sh --action setup returned: $RC" >> $LOG_FILE
if [[ -z "${ZOWE_KEYRING}" ]]; then
${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action setup --service-ext ${SAN} --service-password ${KEYSTORE_PASSWORD} \
--service-alias ${KEYSTORE_ALIAS} --service-keystore ${KEYSTORE_PREFIX} --service-truststore ${TRUSTSTORE_PREFIX} --local-ca-filename ${LOCAL_CA_PREFIX}
RC=$?
echo "apiml_cm.sh --action setup returned: $RC" >> $LOG_FILE
elif [[ "${GENERATE_CERTS_FOR_KEYRING}" != "false" ]]; then
${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action setup --service-ext ${SAN} --service-keystore ${KEYSTORE_PREFIX} \
--service-alias ${KEYSTORE_ALIAS} --zowe-userid ${ZOWE_USER_ID} --zowe-keyring ${ZOWE_KEYRING} --service-storetype "JCERACFKS" --local-ca-filename ${LOCAL_CA_PREFIX}
RC=$?
echo "apiml_cm.sh --action setup returned: $RC" >> $LOG_FILE
else
echo "Generating certificates for the keyring is skipped."
fi
else
(>&2 echo "Zowe Install setup configuration is invalid; check your zowe-setup-certificates.env file.")
(>&2 echo "Some external apiml certificate fields are supplied...Fields must be filled out in full or left completely blank.")
(>&2 echo "See $LOG_FILE for more details.")
echo "</zowe-setup-certificates.sh>" >> $LOG_FILE
rm ${KEYSTORE_PREFIX}* ${TRUSTSTORE_PREFIX}* ${EXTERNAL_CA_PREFIX}* ${LOCAL_CA_PREFIX}* 2> /dev/null
exit 1
fi
else
Expand All @@ -113,25 +129,43 @@ else
EXT_CA_PARM="${EXT_CA_PARM} --external-ca ${CA} "
done

${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action setup --service-ext ${SAN} --service-password ${KEYSTORE_PASSWORD} \
--external-certificate ${EXTERNAL_CERTIFICATE} --external-certificate-alias ${EXTERNAL_CERTIFICATE_ALIAS} ${EXT_CA_PARM} \
--service-alias ${KEYSTORE_ALIAS} --service-keystore ${KEYSTORE_PREFIX} --service-truststore ${TRUSTSTORE_PREFIX} --local-ca-filename ${LOCAL_CA_PREFIX} \
--external-ca-filename ${EXTERNAL_CA_PREFIX}
RC=$?

echo "apiml_cm.sh --action setup returned: $RC" >> $LOG_FILE
if [[ -z "${ZOWE_KEYRING}" ]]; then
${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action setup --service-ext ${SAN} --service-password ${KEYSTORE_PASSWORD} \
--external-certificate ${EXTERNAL_CERTIFICATE} --external-certificate-alias ${EXTERNAL_CERTIFICATE_ALIAS} ${EXT_CA_PARM} \
--service-alias ${KEYSTORE_ALIAS} --service-keystore ${KEYSTORE_PREFIX} --service-truststore ${TRUSTSTORE_PREFIX} --local-ca-filename ${LOCAL_CA_PREFIX} \
--external-ca-filename ${EXTERNAL_CA_PREFIX}
RC=$?
echo "apiml_cm.sh --action setup returned: $RC" >> $LOG_FILE
elif [[ "${GENERATE_CERTS_FOR_KEYRING}" != "false" ]]; then
${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action setup --service-ext ${SAN} --zowe-userid ${ZOWE_USER_ID} --zowe-keyring ${ZOWE_KEYRING} \
--service-storetype "JCERACFKS" --external-certificate ${EXTERNAL_CERTIFICATE} --external-certificate-alias ${EXTERNAL_CERTIFICATE_ALIAS} \
--service-alias ${KEYSTORE_ALIAS} --service-keystore ${KEYSTORE_PREFIX} --local-ca-filename ${LOCAL_CA_PREFIX}
RC=$?
echo "apiml_cm.sh --action setup returned: $RC" >> $LOG_FILE
else
echo "Generating certificates for the keyring is skipped."
fi
fi

if [ "$RC" -ne "0" ]; then
(>&2 echo "apiml_cm.sh --action setup has failed. See $LOG_FILE for more details")
echo "</zowe-setup-certificates.sh>" >> $LOG_FILE
rm ${KEYSTORE_PREFIX}* ${TRUSTSTORE_PREFIX}* ${EXTERNAL_CA_PREFIX}* ${LOCAL_CA_PREFIX}* 2> /dev/null
exit 1
fi

if [[ "${VERIFY_CERTIFICATES}" == "true" ]]; then
${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action trust-zosmf \
--service-password ${KEYSTORE_PASSWORD} --service-truststore ${TRUSTSTORE_PREFIX} --zosmf-certificate "${ZOSMF_CERTIFICATE}" \
--service-keystore ${KEYSTORE_PREFIX}
if [[ -z "${ZOWE_KEYRING}" ]]; then
${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action trust-zosmf \
--service-password ${KEYSTORE_PASSWORD} --service-truststore ${TRUSTSTORE_PREFIX} --zosmf-certificate "${ZOSMF_CERTIFICATE}" \
--service-keystore ${KEYSTORE_PREFIX}
else
export GENERATE_CERTS_FOR_KEYRING;
${ZOWE_ROOT_DIR}/bin/apiml_cm.sh --verbose --log $LOG_FILE --action trust-zosmf --zowe-userid ${ZOWE_USER_ID} \
--zowe-keyring ${ZOWE_KEYRING} --service-storetype "JCERACFKS" --zosmf-certificate "${ZOSMF_CERTIFICATE}" \
--service-keystore ${KEYSTORE_PREFIX} --service-password ${KEYSTORE_PASSWORD} \
--service-truststore ${TRUSTSTORE_PREFIX}
fi
RC=$?

echo "apiml_cm.sh --action trust-zosmf returned: $RC" >> $LOG_FILE
Expand All @@ -141,6 +175,7 @@ if [[ "${VERIFY_CERTIFICATES}" == "true" ]]; then
(>&2 echo "ZOWE_ZOSMF_HOST=${ZOWE_ZOSMF_HOST} ZOWE_ZOSMF_PORT=${ZOWE_ZOSMF_PORT}")
(>&2 echo "You can also specify z/OSMF certificate explicitly in the ZOSMF_CERTIFICATE environmental variable in the zowe-setup-certificates.env file.")
echo "</zowe-setup-certificates.sh>" >> $LOG_FILE
rm ${KEYSTORE_PREFIX}* ${TRUSTSTORE_PREFIX}* ${EXTERNAL_CA_PREFIX}* ${LOCAL_CA_PREFIX}* 2> /dev/null
exit 1
fi
fi
Expand Down Expand Up @@ -173,21 +208,39 @@ fi
ZOWE_CERTIFICATES_ENV=${KEYSTORE_DIRECTORY}/${ZOWE_CERT_ENV_NAME}
rm ${ZOWE_CERTIFICATES_ENV} 2> /dev/null

cat >${KEYSTORE_DIRECTORY}/${ZOWE_CERT_ENV_NAME} <<EOF
KEY_ALIAS=${KEYSTORE_ALIAS}
KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD}
KEYSTORE=${KEYSTORE_PREFIX}.p12
KEYSTORE_TYPE="PKCS12"
TRUSTSTORE=${TRUSTSTORE_PREFIX}.p12
KEYSTORE_KEY=${KEYSTORE_PREFIX}.key
KEYSTORE_CERTIFICATE=${KEYSTORE_PREFIX}.cer-ebcdic
KEYSTORE_CERTIFICATE_AUTHORITY=${LOCAL_CA_PREFIX}.cer-ebcdic
ZOWE_APIM_VERIFY_CERTIFICATES=${VERIFY_CERTIFICATES}
SETUP_APIML_SSO=${SETUP_APIML_SSO}
SSO_FALLBACK_TO_NATIVE_AUTH=${SSO_FALLBACK_TO_NATIVE_AUTH}
PKCS11_TOKEN_NAME=${PKCS11_TOKEN_NAME}
PKCS11_TOKEN_LABEL=${UPPER_KEY_LABEL}
if [[ -z "${ZOWE_KEYRING}" ]]; then
cat >${KEYSTORE_DIRECTORY}/${ZOWE_CERT_ENV_NAME} <<EOF
KEY_ALIAS=${KEYSTORE_ALIAS}
KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD}
KEYSTORE=${KEYSTORE_PREFIX}.p12
KEYSTORE_TYPE="PKCS12"
TRUSTSTORE=${TRUSTSTORE_PREFIX}.p12
KEYSTORE_KEY=${KEYSTORE_PREFIX}.key
KEYSTORE_CERTIFICATE=${KEYSTORE_PREFIX}.cer-ebcdic
KEYSTORE_CERTIFICATE_AUTHORITY=${LOCAL_CA_PREFIX}.cer-ebcdic
ZOWE_APIM_VERIFY_CERTIFICATES=${VERIFY_CERTIFICATES}
SETUP_APIML_SSO=${SETUP_APIML_SSO}
SSO_FALLBACK_TO_NATIVE_AUTH=${SSO_FALLBACK_TO_NATIVE_AUTH}
PKCS11_TOKEN_NAME=${PKCS11_TOKEN_NAME}
PKCS11_TOKEN_LABEL=${UPPER_KEY_LABEL}
EOF
else
cat >${KEYSTORE_DIRECTORY}/${ZOWE_CERT_ENV_NAME} <<EOF
KEY_ALIAS=${KEYSTORE_ALIAS}
KEYSTORE_PASSWORD="password"
KEYRING_OWNER="${ZOWE_USER_ID}"
KEYRING_NAME="${ZOWE_KEYRING}"
KEYSTORE="safkeyring:////\${KEYRING_OWNER}/\${KEYRING_NAME}"
KEYSTORE_TYPE="JCERACFKS"
TRUSTSTORE="safkeyring:////\${KEYRING_OWNER}/\${KEYRING_NAME}"
ZOWE_APIM_VERIFY_CERTIFICATES=${VERIFY_CERTIFICATES}
SETUP_APIML_SSO=${SETUP_APIML_SSO}
SSO_FALLBACK_TO_NATIVE_AUTH=${SSO_FALLBACK_TO_NATIVE_AUTH}
PKCS11_TOKEN_NAME=${PKCS11_TOKEN_NAME}
PKCS11_TOKEN_LABEL=${UPPER_KEY_LABEL}
EOF
fi

# set up privileges and ownership
chmod -R 500 ${KEYSTORE_DIRECTORY}/${LOCAL_KEYSTORE_SUBDIR}/* ${KEYSTORE_DIRECTORY}/${KEYSTORE_ALIAS}/*
echo "Trying to change an owner of the ${KEYSTORE_DIRECTORY}."
Expand Down
Loading