MessageProtectionOrder 열거형

정의

메시지를 보호하는 작업의 순서를 지정합니다.

public enum class MessageProtectionOrder
public enum MessageProtectionOrder
type MessageProtectionOrder = 
Public Enum MessageProtectionOrder
상속
MessageProtectionOrder

필드

EncryptBeforeSign 2

디지털 서명을 SOAP 메시지용으로 생성하기 전에 SOAP 메시지가 암호화되도록 지정합니다.

SignBeforeEncrypt 0

SOAP 메시지의 일부분을 암호화하기 전에 SOAP 메시지용 디지털 서명을 생성하되, 해당 디지털 서명은 암호화되지 않도록 지정합니다.

SignBeforeEncryptAndEncryptSignature 1

SOAP 메시지의 일부분을 암호화하기 전에 SOAP 메시지용 디지털 서명을 생성하고, 해당 디지털 서명이 암호화되도록 지정합니다.

예제

다음 예제는 SymmetricSecurityBindingElement 요소 집합과 해당 MessageProtectionOrder SignBeforeEncrypt 속성입니다.

public static Binding CreateCustomBinding()
{
    // Create an empty BindingElementCollection to populate,
    // then create a custom binding from it.
    BindingElementCollection outputBec = new BindingElementCollection();

    // Create a SymmetricSecurityBindingElement.
    SymmetricSecurityBindingElement ssbe =
        new SymmetricSecurityBindingElement();

    // Set the algorithm suite to one that uses 128-bit keys.
    ssbe.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic128;

       // Set MessageProtectionOrder to SignBeforeEncrypt.
    ssbe.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncrypt;

    // Use a Kerberos token as the protection token.
    ssbe.ProtectionTokenParameters = new KerberosSecurityTokenParameters();

    // Add the SymmetricSecurityBindingElement to the BindingElementCollection.
    outputBec.Add ( ssbe );
    outputBec.Add(new TextMessageEncodingBindingElement());
    outputBec.Add(new HttpTransportBindingElement());

    // Create a CustomBinding and return it; otherwise, return null.
    return new CustomBinding(outputBec);
}
Public Shared Function CreateCustomBinding() As Binding 
    ' Create an empty BindingElementCollection to populate, 
    ' then create a custom binding from it.
    Dim outputBec As New BindingElementCollection()
    
    ' Create a SymmetricSecurityBindingElement.
    Dim ssbe As New SymmetricSecurityBindingElement()
    
    ' Set the algorithm suite to one that uses 128-bit keys.
    ssbe.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic128
    
    ' Set MessageProtectionOrder to SignBeforeEncrypt.
    ssbe.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncrypt
    
    ' Use a Kerberos token as the protection token.
    ssbe.ProtectionTokenParameters = New KerberosSecurityTokenParameters()
    
    ' Add the SymmetricSecurityBindingElement to the BindingElementCollection.
    outputBec.Add(ssbe)
    outputBec.Add(New TextMessageEncodingBindingElement())
    outputBec.Add(New HttpTransportBindingElement())
    
    ' Create a CustomBinding and return it; otherwise, return null.
    Return New CustomBinding(outputBec)

End Function

설명

이 열거형은 AsymmetricSecurityBindingElement.MessageProtectionOrderAsymmetricSecurityBindingElement 속성 및 SymmetricSecurityBindingElement.MessageProtectionOrder 클래스의 SymmetricSecurityBindingElement 속성과 함께 사용됩니다.

메시지 (예: 메시지 짧은 되었거나 엔트로피가 낮음) 다이제스트 공격에 취약 한 경우 SignBeforeEncryptAndEncryptSignature 또는 EncryptBeforeSign 옵션을 사용 해야 합니다. (엔트로피 서버, 클라이언트 또는 둘 다에서 제공 하는 임의의 데이터 이며 데이터 암호화 및 해독에 대 한 공유 키를 만드는 데 사용 됩니다.)

순서 지정 정의

WCF는 메시지는 방법을 결정 하는 세 가지 다른 보호 수준을 제공 하는 SOAP 메시지 보안을 사용 하 여 보호 합니다. 기본값은 SignBeforeEncryptAndEncryptSignature입니다. 이 설정은 우선 메시지에 서명하고, 메시지 본문을 암호화한 다음, XML 서명을 암호화합니다. 이는 서명에 대한 암호화 추측 공격의 가능성을 줄여 줍니다.

그러나 기본값을 사용하면 성능에 영향을 줄 수 있습니다. 실제로 향상된 보안을 위해 성능상 장단점이 있습니다. 서명을 암호화하면 성능이 10%에서 40% 정도 줄어들 수 있습니다. 메시지의 데이터 콘텐츠를 낮은 값의 성능 처리량이 더 중요할 경우 SignBeforeEncrypt를 사용 합니다. 이 설정을 사용할 경우 서명 다이제스트는 일반 텍스트로 보내지며, 따라서 메시지는 낮은 엔트로피에 대한 추측 및 확인 공격에 더 취약합니다.

사용자 지정 바인딩 전용입니다.

MessageProtectionOrder 속성을 변경하려면 사용자 지정 보안 바인딩을 만들어야 합니다. 사용자 지정 바인딩을 만드는 방법에 대 한 자세한 내용은 참조 하세요. Creating User-Defined 바인딩합니다. 특정 인증 모드용 사용자 지정 바인딩을 만드는 방법에 대 한 자세한 내용은 참조 하세요. 방법: 지정 된 인증 모드에 대 한 SecurityBindingElement 만들기합니다.

적용 대상

추가 정보