z/OS での鍵ストアの CMS フォーマットへの変換

z/OS システム上の Liberty 集合に対して動的ルーティングをセットアップできます。そのタスクの 1 つの要素に、鍵ストアの CMS フォーマットへの変換があります。

提供されているサンプル・スクリプトは、ikeycmd 用に CMS プロバイダーをセットアップする方法の例です。ご使用の環境はこれとは異なることがあります。CMS プロバイダーの場所を探索し、正しいプロバイダー・オフセットを指定する必要があります。

z/OS では、『Liberty 集合に対する動的ルーティングのセットアップ』の ステップ 5 の両方の gskcmd コマンドは、gskcmd の代わりに、ikeycmd を使用して実行する必要があります。ikeycmd コマンドには、サンプル・スクリプトで示されているように、追加の -Djava.security.properties を含め、適切なプロバイダー・オフセットの CMS プロバイダーを付加する必要があります。各コマンドの -Djava.security.properties パラメーターは、『Liberty 集合に対する動的ルーティングのセットアップ』のステップ 5 で指定されている他のパラメーターより前になければなりません。

#!/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

トピックのタイプを示すアイコン 参照トピック

ファイル名: rwlp_wve_convertks2cms.html