WebSphere Application Server - Express for i5/OS, Version 6.1   
             オペレーティング・システム: i5/OS

             目次と検索結果のパーソナライズ化
このトピックは、i5/OS オペレーティング・システムにのみ適用されます。

例: セキュリティーを使用可能にした状態でのシンまたはプラグ可能アプリケーション・クライアントの実行

WebSphere Application Server インスタンスにセキュリティーを使用可能にした場合、Java シン・アプリケーション・クライアントは、セキュリティー・プロバイダーを設定するための追加コードを必要としません。 マイグレーションおよび互換性の問題を防ぐために、iSeries Java シン またはプラグ可能アプリケーション・クライアントで検出されたこのコードを除去する必要があります。 プロパティー・ディレクトリーの WebSphere インスタンスからの java.security ファイルは、現在セキュリティー・プロバイダーを構成するために使用されています。

セキュリティー・プロバイダーが、main() メソッドでプログラマチックに設定され、エンタープライズ Bean にアクセスしたコードの前に置かれました。
import java.security.*;
  ...
  if (System.getProperty("os.name").equals("OS/400")) {

    // Set the default provider list first.
    Provider jceProv = null;
    Provider jsseProv = null;
    Provider sunProv = null;

    // Allow for when the Provider is not needed, when 
    // it is not in the client application's classpath.
    try {
      jceProv = new com.ibm.crypto.provider.IBMJCE();
    }
    catch(Exception ex) {
ex.printStackTrace();
    throw new Exception("Unable to acquire provider.");
	}

    try {
      jsseProv = new com.ibm.jsse.JSSEProvider();
    }
    catch(Exception ex) {
ex.printStackTrace();
    throw new Exception("Unable to acquire provider.");
	}

    try {
      sunProv = new sun.security.provider.Sun();
    }
    catch(Exception ex) {
ex.printStackTrace();
    throw new Exception("Unable to acquire provider.");
	}

    // Enable providers early and ahead of other providers
    // for consistent performance and function.
    if ( (null != sunProv) && (1 != Security.insertProviderAt(sunProv, 1)) ) {
      Security.removeProvider(sunProv.getName());
      Security.insertProviderAt(sunProv, 1);
    }
    if ( (null != jceProv) && (2 != Security.insertProviderAt(jceProv, 2)) ) {
      Security.removeProvider(jceProv.getName());
      Security.insertProviderAt(jceProv, 2);
    }
    if ( (null != jsseProv) && (3 != Security.insertProviderAt(jsseProv, 3)) ) {
      Security.removeProvider(jsseProv.getName());
      Security.insertProviderAt(jsseProv, 3);
    }

    // Adjust default ordering based on admin/startstd properties file.
    // Maximum allowed in property file is 20.
    String provName;
    Class  provClass;
    Object provObj =  null;

    for (int i = 0; i < 21; i++) {
      provName = System.getProperty("os400.security.provider."+ i);

      if (null != provName) {

        try {
          provClass = Class.forName(provName);
          provObj = provClass.newInstance();
        }
        catch(Exception ex) {
          // provider not found
          continue;
        }

        if (i != Security.insertProviderAt((Provider) provObj, i)) {

          // index 0 adds to end of existing list
          if (i != 0) {
            Security.removeProvider(((Provider) provObj).getName());
            Security.insertProviderAt((Provider) provObj, i);
          }
        }
      } // end if (null != provName)
    } // end for (int i = 0; i < 21; i++)
  } // end if ("os.name").equals("OS/400")



関連タスク
シン・アプリケーション・クライアント・コードの実行
参照トピック    

ご利用条件 | フィードバック

最終更新: Jan 21, 2008 7:05:28 PM EST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.express.iseries.doc/info/iseriesexp/ae/tcli_thinsec.html