예: 보안이 가능한 상태에서 씬 클라이언트 실행

WebSphere® Application Server 인스턴스에 대한 보안을 사용 가능하게 한 경우 Java™ 씬 애플리케이션 클라이언트는 더 이상 보안 제공자를 설정할 추가 코드를 필요로 하지 않습니다. IBM i 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")

주제 유형을 표시하는 아이콘 참조 주제



시간소인 아이콘 마지막 업데이트 날짜: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tcli_thinsec
파일 이름:tcli_thinsec.html