SSL을 위한 사용자 정의 키 관리자 작성

사용자 정의 키 관리자 구성을 임의의 관리 범위에 작성하고 새 키 관리자를 SSL(Secure Sockets Layer) 구성과 연관시킬 수 있습니다.

시작하기 전에

WebSphere® Application Server의 was.install.root/lib/ext 디렉토리에서 사용자 정의 키 관리자를 위해 Java™ Archive(.JAR) 파일을 개발, 패키지 및 찾아야 합니다.

이 태스크 정보

관리 콘솔에서 다음 단계를 완료하십시오.

프로시저

  1. 예를 들어, 셀 범위 또는 노드, 서버 또는 클러스터에서 셀 범위 아래에 사용자 정의 키 관리자를 작성하고 싶은지 여부를 결정하십시오.
    중요사항: 셀 범위 아래의 레벨에 사용자 정의 키 관리자를 작성하면, 이를 동일 범위 또는 이상에 있는 SSL(Secure Sockets Layer) 구성과만 연관시킬 수 있습니다. 키 관리자보다 낮은 범위에 있는 SSL 구성은 키 관리자 구성을 보지 않습니다.
    • 셀 범위에서 사용자 정의 키 관리자를 작성하려면 보안 > SSL 인증서 및 키 관리 > 키 관리자를 클릭하십시오. 셀의 모든 SSL 구성은 셀 범위에서 키 관리자를 선택할 수 있습니다.
    • 셀 레벨 아래의 범위에서 사용자 정의 키 관리자를 작성하려면 보안 > SSL 인증서 및 키 관리 > 엔드포인트 보안 구성 관리 > {인바운드 | 아웃바운드} > SSL_configuration > 키 관리자를 클릭하십시오.
  2. 새 키 관리자를 작성하려면 새로 작성을 클릭하십시오.
  3. 고유한 키 관리자 이름을 입력하십시오.
  4. 사용자 정의 구현 설정을 선택하십시오. 사용자 정의 설정을 사용하면 Java 인터페이스 javax.net.ssl.X509KeyManager 및 선택적으로 com.ibm.wsspi.ssl.KeyManagerExtendedInfo WebSphere Application Server 인터페이스에 구현이 있는 Java 클래스를 정의할 수 있습니다. 표준 구현 설정은 키 관리자가 Java 보안 제공자 목록에 제공자 및 알고리즘으로서 정의되어 있는 경우에만 적용되고, 이는 사용자 정의 키 관리자를 위한 경우가 아닙니다. 일반 표준 키 관리자는 algorithm = IbmX509, provider = IBMJSSE2입니다.
  5. 클래스 이름을 입력하십시오. 예를 들어, com.ibm.test.CustomKeyManager입니다.
  6. 다음 조치 중 하나를 선택하십시오.
    • 적용을 클릭한 다음 추가 특성 아래에서 사용자 정의 특성을 클릭하여 새 사용자 정의 키 관리자에 사용자 정의 특성을 추가하십시오. 사용자 정의 특성 추가를 완료한 경우에는 확인저장을 클릭한 후 다음 단계로 이동하십시오.
    • 확인저장을 클릭한 후 다음 단계로 이동하십시오.
  7. 페이지 탐색에서 SSL 인증서 및 키 관리를 클릭하십시오.
  8. 다음 조치 중 하나를 선택하십시오.
    • 셀 범위 SSL 구성에 대해 관련 항목 아래에서 SSL 구성을 클릭하십시오.
    • 낮은 범위에 있는 SSL 구성을 선택하려면 엔드포인트 보안 구성 관리를 클릭하십시오.
  9. 새 사용자 정의 키 관리자와 연관시키고 싶은 기존 SSL 구성에 대한 링크를 클릭하십시오. 사용자 정의 키 관리자를 기존 구성과 연관시키는 대신에 새 SSL 구성을 작성할 수 있습니다. 자세한 정보는 다음 예를 참조하십시오.
  10. 추가 특성 아래에서 신뢰 및 키 관리자를 클릭하십시오.
  11. 키 관리자 드롭 다운 목록에서 새 사용자 정의 키 관리자를 선택하십시오. 새 사용자 정의 키 관리자가 나열되지 않은 경우에는 8단계에서 선택한 범위와 같은 레벨 또는 아래에 있는 SSL 구성 범위를 선택했는지 확인하십시오.
  12. 확인을 클릭하고 저장을 클릭하십시오.

결과

WebSphere Application Server의 설치 디렉토리에서 JAR 파일을 참조하고 사용자 정의 구성을 연결 핸드쉐이크 동안에 SSL 구성과 연관시키는 사용자 정의 키 관리자 구성을 작성했습니다.

사용자 정의 SSL(Secure Sockets Layer) 키 선택을 위해 사용자 정의 키 관리자 개발. 다음 예는 샘플 사용자 정의 키 관리자의 예입니다. 이 단순 키 관리자는 별명 특성 com.ibm.ssl.keyStoreClientAlias 또는 com.ibm.ssl.keyStoreServerAlias를 사용하여 설정된 경우에는 연결의 어떤 측면에 키 관리자가 사용되는지에 따라 구성된 별명을 리턴합니다. 키 관리자는 이러한 특성이 설정되지 않은 경우에는 별명을 선택하기 위해 JSSE 기본 IbmX509 키 관리자를 따릅니다.

사용자 정의 키 관리자를 빌드하고 패키지한 후에는 순수한 클라이언트의 경우 ssl.client.props 파일로부터 이를 구성하거나 관리 콘솔에서 SSLConfiguration KeyManager 링크를 사용하여 이를 구성할 수 있습니다. 키 관리자에 대한 자세한 정보는 X.509 인증서 ID의 키 관리자 제어의 내용을 참조하십시오.

지정된 SSL(Secure Sockets Layer) 구성에 대해 키 관리자는 한 번에 하나만 구성될 수 있으므로 서버측의 인증서 선택사항은 기본 IbmX509 키 관리자가 지정될 때처럼 작동하지 않을 수도 있습니다. 사용자 정의 키 관리자가 구성되면, 제공된 SSL 구성으로부터 별명의 선택이 chooseClientAlias 또는 chooseServerAlias가 호출될 때 제대로 설정되었는지 확인하는 것은 해당 키 관리자의 소유자에 달려 있습니다. com.ibm.ssl.keyStoreClientAliascom.ibm.ssl.keyStoreServerAlias SSL 특성을 찾으십시오.
참고: 이 예는 샘플로만 사용되어야 하고 지원되지 않습니다.
package com.ibm.test;

import java.security.cert.X509Certificate;
import com.ibm.wsspi.ssl.KeyManagerExtendedInfo;

public final class CustomKeyManager 
	implements javax.net.ssl.X509KeyManager, com.ibm.wsspi.ssl.KeyManagerExtendedInfo
{
    private java.util.Properties props = null;
    private java.security.KeyStore ks = null;
    private javax.net.ssl.X509KeyManager km = null;
    private java.util.Properties sslConfig = null;
    private String clientAlias = null;
    private String serverAlias = null;
    private int clientslotnum = 0;
    private int serverslotnum = 0;

    public CustomKeyManager()
    {
    }

    /**
     * Method called by WebSphere Application Server runtime to set the custom
     * properties.
     * 
     * @param java.util.Properties - custom props
     */
    public void setCustomProperties(java.util.Properties customProps)
    {
        props = customProps;
    }

    private java.util.Properties getCustomProperties()
    {
        return props;
    }

    /**
     * Method called by WebSphere Application Server runtime to set the SSL
     * configuration properties being used for this connection.
     * 
     * @param java.util.Properties - contains a property for the SSL configuration.
     */
    public void setSSLConfig(java.util.Properties config)
    {
        sslConfig = config;                                   
    }

    private java.util.Properties getSSLConfig()
    {
        return sslConfig;
    }

    /**
     * Method called by WebSphere Application Server runtime to set the default
     * X509KeyManager created by the IbmX509 KeyManagerFactory using the KeyStore
     * information present in this SSL configuration.  This allows some delegation
     * to the default IbmX509 KeyManager to occur.
     * 
     * @param javax.net.ssl.KeyManager defaultX509KeyManager - default key manager for IbmX509
     */
    public void setDefaultX509KeyManager(javax.net.ssl.X509KeyManager defaultX509KeyManager)
    {
        km = defaultX509KeyManager;
    }

    public javax.net.ssl.X509KeyManager getDefaultX509KeyManager()
    {
        return km;
    }

    /**
     * Method called by WebSphere Application Server runtime to set the SSL
     * KeyStore used for this connection.
     * 
     * @param java.security.KeyStore - the KeyStore currently configured
     */
    public void setKeyStore(java.security.KeyStore keyStore)
    {
        ks = keyStore;
    }

    public java.security.KeyStore getKeyStore()
    {
        return ks;
    }

 /**
     * Method called by custom code to set the server alias.
     * 
     * @param String - the server alias to use
     */
    public void setKeyStoreServerAlias(String alias)
    {
        serverAlias = alias;
    }

    private String getKeyStoreServerAlias()
    {
        return serverAlias;
    }

    /**
     * Method called by custom code to set the client alias.
     * 
     * @param String - the client alias to use
     */
    public void setKeyStoreClientAlias(String alias)
    {
        clientAlias = alias;
    }
    
    private String getKeyStoreClientAlias()
    {
        return clientAlias;
    }

    /**
     * Method called by custom code to set the client alias and slot (if necessary).
     * 
     * @param String - the client alias to use
     * @param int - the slot to use (for hardware)
     */
    public void setClientAlias(String alias, int slotnum) throws Exception
    {
        if ( !ks.containsAlias(alias))
        {
            throw new IllegalArgumentException ( "Client alias " + alias + " 
            not found in keystore." );
        }
        this.clientAlias = alias;
        this.clientslotnum = slotnum;
    }

    /**
     * Method called by custom code to set the server alias and slot (if necessary).
     * 
     * @param String - the server alias to use
     * @param int - the slot to use (for hardware)
     */
    public void setServerAlias(String alias, int slotnum) throws Exception
    {
        if ( ! ks.containsAlias(alias))
        {
            throw new IllegalArgumentException ( "Server alias " + alias + " 
            not found in keystore." );
        }
        this.serverAlias = alias;
        this.serverslotnum = slotnum;
    }


    /**
     * Method called by JSSE runtime to when an alias is needed for a client
     * connection where a client certificate is required.
     * 
     * @param String keyType
     * @param Principal[] issuers
     * @param java.net.Socket socket (not always present)
     */
    public String chooseClientAlias(String[] keyType, java.security.Principal[]
    issuers, java.net.Socket socket)
    {
        if (clientAlias != null && !clientAlias.equals(""))
        {
            String[] list = km.getClientAliases(keyType[0], issuers);
            String aliases = "";

            if (list != null)
            {
                boolean found=false;
                for (int i=0; i<list.length; i++)
                {
                    aliases += list[i] + " ";
                    if (clientAlias.equalsIgnoreCase(list[i]))
                        found=true;
                }

                if (found)
                {
                    return clientAlias;
                }

            }
        }
        
        // client alias not found, let the default key manager choose.
        String[] keyArray = new String [] {keyType[0]};
        String alias = km.chooseClientAlias(keyArray, issuers, null);
        return alias.toLowerCase();
    }

    /**
     * Method called by JSSE runtime to when an alias is needed for a server
     * connection to provide the server identity.
     * 
     * @param String[] keyType
     * @param Principal[] issuers
     * @param java.net.Socket socket (not always present)
     */
    public String chooseServerAlias(String keyType, java.security.Principal[] 
    issuers, java.net.Socket socket)
    {
        if (serverAlias != null && !serverAlias.equals(""))
        {
            // get the list of aliases in the keystore from the default key manager
            String[] list = km.getServerAliases(keyType, issuers);
            String aliases = "";

            if (list != null)
            {
                boolean found=false;
                for (int i=0; i<list.length; i++)
                {
                    aliases += list[i] + " ";
                    if (serverAlias.equalsIgnoreCase(list[i]))
                        found = true;
                }

                if (found)
                {
                    return serverAlias;
                }
            }
        }

        // specified alias not found, let the default key manager choose.
        String alias = km.chooseServerAlias(keyType, issuers, null);
        return alias.toLowerCase();
    }

    public String[] getClientAliases(String keyType, java.security.Principal[] issuers)
    {
        return km.getClientAliases(keyType, issuers);
    }

    public String[] getServerAliases(String keyType, java.security.Principal[] issuers)
    {
        return km.getServerAliases(keyType, issuers);
    }

    public java.security.PrivateKey getPrivateKey(String s)
    {
        return km.getPrivateKey(s);
    }

    public java.security.cert.X509Certificate[] getCertificateChain(String s)
    {
        return km.getCertificateChain(s);
    }

    public javax.net.ssl.X509KeyManager getX509KeyManager()
    {
        return km;
    }

}

다음에 수행할 작업

순수한 클라이언트를 위해 사용자 정의 키 관리자를 작성할 수 있습니다. 자세한 정보는 AdminTask 오브젝트에 대한 keyManagerCommands 명령 그룹을 참조하십시오.

주제 유형을 표시하는 아이콘 태스크 주제



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