在 z/OS 上将密钥库转换为 CMS 格式
您可以在 z/OS 系统上为 Liberty 集合体设置动态路由选择。此任务的一个元素是将密钥库转换为 CMS 格式。
提供的样本脚本是有关如何为 ikeycmd 设置 CMS 提供程序的示例。您的环境可能会有所不同。必须确保找到 CMS 提供程序并指定正确提供程序偏移量。
必须运行步骤 5 为 Liberty 集合体设置动态路由选择中的 gskcmd 命令,针对 z/OS,使用 ikeycmd 来代替 gskcmd。ikeycmd 命令必须包含样本脚本中指示的其他 -Djava.security.properties,以使用相应提供程序偏移量附加 CMS 提供程序。针对每个命令,-Djava.security.properties 参数必须位于在步骤 5“为 Liberty 集合体设置动态路由选择”中指定的其他参数之前。
#!/bin/sh
# z/os ikeycmd wrapper that adds CMS v3 support.
# Author:
if [ -n "$JAVA_HOME" ]; then
echo "Using JAVA_HOME=$JAVA_HOME"
else
JAVA_HOME=/usr/lpp/java/java800/J8.0_64/
fi
# Should not require edits below this line
> /tmp/java.security.append
# Check for non-v3 CMS provider in java.security.
if grep CMSProvider $JAVA_HOME/lib/security/java.security >/dev/null; then
if ! grep -i "CMSProvider V3" $JAVA_HOME/lib/security/java.security; then
echo "CMS Provider already present, but no 'V3' argument: $JAVA_HOME/lib/security/java.security"
exit 1
fi
else
# Need to add CMSv3 provider.
# Hunt for the next provider offset
let NEXT_PROVIDER=1
for PROVIDER in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
if grep security.provider.$PROVIDER $JAVA_HOME/lib/security/java.security >/dev/null; then
let NEXT_PROVIDER=$NEXT_PROVIDER+1
fi
done
# Stash the provider line in a file
echo "security.provider.$NEXT_PROVIDER=com.ibm.security.cmskeystore.CMSProvider V3" > /tmp/java.security.append
fi
if [ $# -eq 0 ]; then
$JAVA_HOME/bin/ikeycmd -Djava.security.properties=/tmp/java.security.append -help
else
$JAVA_HOME/bin/ikeycmd -Djava.security.properties=/tmp/java.security.append "$@"
fi