클라이언트에 대한 응답 서명 검증 메소드 구성

WSSVerification 및 WSSVerifyPart API를 사용하여 서명 검증 메소드를 선택할 수 있습니다. 요청 서명 검증 메소드에는 요약 알고리즘 및 전송 메소드가 있습니다.

시작하기 전에

SOAP 메시지를 보안 설정하기 위해 서명 검증 정보의 구성을 완료하려면 다음 알고리즘 태스크를 수행해야 합니다.
  • WSSVerification API를 사용하여 정규화 및 서명 메소드를 구성하십시오.
  • 요청 서명을 위해 클라이언트를 구성할 때 사용할 알고리즘 메소드를 구성하려면
WSSVerifyPart API를 사용하여 요약 및 변환 메소드를 구성하십시오.

이 태스크 정보

다음 테이블에서는 이 정보의 목적에 대해 설명합니다. 이러한 정의 중 일부는 XML-Signature 명세를 기반으로 하며, 다음 웹 주소에 위치합니다.http://www.w3.org/TR/xmldsig-core

표 1. 서명 검증 메소드. 서명 검증 정보를 사용하여 메시지를 보안 설정하십시오.
메소드 이름 목적
요약 알고리즘 지정된 경우 <DigestValue> 요소를 생성하도록 변환을 적용한 후에 데이터에 적용합니다. <DigestValue> 요소에 서명하면 자원 컨텐츠가 서명자 키에 바인드됩니다. 클라이언트 요청 전송자 구성을 위해 선택한 알고리즘이 클라이언트 요청 수신자 요청에서 선택한 알고리즘과 일치해야 합니다.
변환 알고리즘 <Transform> 요소에 적용합니다.
서명 알고리즘 서명 검증 메소드의 URI(Uniform Resource Identifier)를 지정합니다.
정형화 알고리즘 정규화 메소드의 URI(Uniform Resource Identifier)를 지정합니다.

메시지에 디지털로 서명하도록 클라이언트를 구성한 후 디지털 서명을 검증하도록 클라이언트를 구성해야 합니다. WSS API를 사용하거나 관리 콘솔을 통해 정책 세트를 구성하여 디지털 서명을 검증하고 검증을 선택하고 파트 알고리즘을 검증할 수 있습니다. 구성에 WSS API를 사용하는 경우 WSSVerification 및 WSSVerifyPart API를 사용하여 검증할 디지털 서명 메시지 파트를 지정하고 요청 서명을 위해 클라이언트를 구성할 때 사용할 알고리즘 메소드를 지정하십시오.

WSSVerification 및 WSSVerifyPart API는 다음 단계를 수행하여 서명 검증 및 검증 알고리즘 메소드를 구성합니다.

프로시저

  1. 이용자 바인딩의 경우, WSSVerification API는 서명 검증을 허용하는 서명 메소드를 지정합니다. WebSphere® Application Server는 다음 사전 구성된 서명 메소드를 지원합니다.
    • WSSVerification.RSA_SHA1(기본값): http://www.w3.org/2000/09/xmldsig#rsa-sha1
    • WSSVerification.HMAC_SHA1: http://www.w3.org/2000/09/xmldsig#hmac-sha1
    DSA-SHA1 디지털 서명 메소드(http://www.w3.org/2000/09/xmldsig#dsa-sha1)는 지원되지 않습니다.
  2. 이용자 바인딩의 경우, WSSVerification API는 서명 검증을 허용하는 정규화 메소드를 지정합니다. WebSphere Application Server는 기본적으로 다음 사전 구성된 정규화 메소드를 지원합니다.
    • WSSVerification.EXC_C14N(기본값): http://www.w3.org/2001/10/xml-exc-c14n#
    • WSSVerification.C14N: http://www.w3.org/2001/10/xml-c14n#
  3. 이용자 바인딩의 경우 필요에 따라 WSSVerifyPart API는 요약 메소드를 지정합니다. WebSphere Application Server는 서명된 파트 검증에 대해 다음 요약 메소드 알고리즘을 지원합니다.
    • WSSVerifyPart.SHA1(기본값): http://www.w3.org/2000/09/xmldsig#sha1
    • WSSVerifyPart.SHA256: http://www.w3.org/2001/04/xmlenc#sha256
    • WSSVerifyPart.SHA512: http://www.w3.org/2001/04/xmlenc#sha512
  4. 이용자 바인딩의 경우 WSSVerifyPart API는 변환 메소드를 지정합니다. WebSphere Application Server는 검증 파트에 대해 다음 변환 알고리즘을 지원합니다.
    • WSSVerifyPart.TRANSFORM_EXC_C14N(기본값): http://www.w3.org/2001/10/xml-exc-c14n#
    • WSSVerifyPart.TRANSFORM_XPATH2_FILTER: http://www.w3.org/2002/06/xmldsig-filter2
    • WSSVerifyPart.TRANSFORM_STRT10: http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform
    • WSSVerifyPart.TRANSFORM_ENVELOPED_SIGNATURE: http://www.w3.org/2000/09/xmldsig#enveloped-signature

    WSS API의 경우 WebSphere Application Server는 다음 알고리즘을 지원하지 않습니다.

    • http://www.w3.org/2002/07/decrypt#XML
    • http://www.w3.org/TR/1999/REC-xpath-19991116

결과

클라이언트가 메시지를 전송할 때 디지털 서명 검증 시 사용할 메소드를 지정했습니다.

다음 예제는 본문을 검증할 파트로, HMAC_SHA1을 서명 메소드로, C14N 및 EXC_C14N을 정규화 메소드의 후보로, TRANSFORM_STRT10을 변환 메소드로, SHA256을 요약 메소드로 검증 정보를 지정하는 샘플 WSS API 코드를 제공합니다.

// Get the message context
   Object msgcontext = getMessageContext();

// Generate the WSSFactory instance
   WSSFactory factory = WSSFactory.getInstance();

// Generate the WSSConsumingContext instance
   WSSConsumingContext concont = factory.newWSSConsumingContext();

// Generate the certificate list
   String certpath = "intca2.cer";
// The location of the X509 certificate file
      X509Certificate x509cert = null;
      try {
            InputStream is = new FileInputStream(certpath);
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
	          x509cert = (X509Certificate)cf.generateCertificate(is);
      } catch(FileNotFoundException e1){
	         throw new WSSException(e1);
      } catch (CertificateException e2) {
	         throw new WSSException(e2);
      }

      Set<Object> eeCerts = new HashSet<Object>();
      eeCerts.add(x509cert);  
// Create the certStore
   java.util.List<CertStore> certList = new 
        java.util.ArrayList<CertStore>();
   CollectionCertStoreParameters certparam = new 
        CollectionCertStoreParameters(eeCerts);
   CertStore cert = null;
      try {
	           cert = CertStore.getInstance("Collection", 
                                           certparam, 
                                          "IBMCertPath");
      } catch (NoSuchProviderException e1) {
	          throw new WSSException(e1);
      } catch (InvalidAlgorithmParameterException e2) {
	          throw new WSSException(e2);
      } catch (NoSuchAlgorithmException e3) {
	          throw new WSSException (e3);
      }
      if(certList != null ){
	           certList.add(cert);
      }

// Generate the callback handler
   X509ConsumeCallbackHandler callbackHandler = new 
      X509ConsumeCallbackHandler(
                                 "dsig-receiver.ks", 
                                 "jks",
                                 "server".toCharArray(), 
                                 certList, 
                                 java.security.Security.getProvider(
                                       "IBMCertPath")
                                 );

// Generate the WSSVerification instance
   WSSVerification ver = factory.newWSSVerification(X509Token.class, 
                                                    callbackHandler);

// Set one or more candidates of the signature method used for 
//    verification (step. 1)
// DEFAULT : WSSVerification.RSA_SHA1
      ver.addAllowedSignatureMethod(WSSVerification.HMAC_SHA1);

// Set one or more candidates of the canonicalization method used for 
//    verification (step. 2)
// DEFAULT : WSSVerification.EXC_C14N 
      ver.addAllowedCanonicalizationMethod(WSSVerification.C14N);
      ver.addAllowedCanonicalizationMethod(WSSVerification.EXC_C14N);

// Set the part to be specified by WSSVerifyPart
   WSSVerifyPart verPart = factory.newWSSVerifyPart();

// Set the part to be specified by the keyword
      verPart.setRequiredVerifyPart(WSSVerification.BODY);

// Set the candidates of digest methods to use for verification (step. 3)
// DEFAULT : WSSVerifypart.TRANSFORM_EXC_C14N : String
      verPart.addAllowedTransform(WSSVerifyPart.TRANSFORM_STRT10);

// Set the candidates of digest methods to use for verification (step. 4)
// DEFAULT : WSSVerifyPart.SHA1
      verPart.addAllowedDigestMethod(WSSVerifyPart.SHA256);

// Set WSSVerifyPart to WSSVerification
      ver.addRequiredVerifyPart(verPart);

// Add the WSSVerification to the WSSConsumingContext
   concont.add(ver);

// Validate the WS-Security header
concont.process(msgcontext);

다음에 수행할 작업

서명 검증 알고리즘 구성을 완료했습니다. 아직 구성하지 않은 경우 암호화 또는 복호화 알고리즘을 구성하십시오. 또는 필요에 따라 보안 토큰 정보를 구성하십시오.


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



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