OperationContractAttribute.ProtectionLevel 속성

정의

작업의 메시지에 대해 암호화, 서명 또는 둘 모두를 수행해야 할지 지정하는 값을 가져오거나 설정합니다.

public:
 property System::Net::Security::ProtectionLevel ProtectionLevel { System::Net::Security::ProtectionLevel get(); void set(System::Net::Security::ProtectionLevel value); };
public System.Net.Security.ProtectionLevel ProtectionLevel { get; set; }
member this.ProtectionLevel : System.Net.Security.ProtectionLevel with get, set
Public Property ProtectionLevel As ProtectionLevel

속성 값

ProtectionLevel

ProtectionLevel 값 중 하나입니다. 기본값은 None입니다.

예외

값이 ProtectionLevel 값 중 하나가 아닌 경우

설명

ProtectionLevel 속성을 사용하여 작업의 메시지를 암호화, 서명 또는 둘 다 사용해야 하는지 여부를 제어할 수 있습니다. 더 좁은 범위가 이 값을 재정의하지 않는 한 여기에 설정된 값은 이 작업에 대해 지정된 모든 메시지의 기본값입니다.

런타임 시 보호 동작은 다음 속성에 설정된 보호 수준 값의 조합이라는 점을 기억해야 합니다. 이러한 속성에는 계층 구조가 있습니다. 가장 바깥쪽 값을 설정하면 더 좁은 범위에 대해 다른 값이 명시적으로 설정되지 않는 한 모든 좁은 범위에 대한 기본 설정이 설정됩니다. 이 경우 외부 값은 특별히 설정된 것을 제외하고 모든 좁은 범위의 기본값으로 유지됩니다.

예를 들어 설정 ProtectionLevel.EncryptAndSign 되고 다른 좁은 범위에 보호 수준 설정이 없는 경우 ServiceContractAttribute.ProtectionLevel 작업 계약의 모든 메시지가 암호화되고 서명됩니다. 그러나 이러한 작업 중 하나에 설정된 ProtectionLevel.Sign경우 해당 작업에 ProtectionLevel 대한 메시지는 서명되지만 계약의 다른 모든 메시지는 암호화되고 서명됩니다.

보호 수준 및 해당 가정 및 범위에 대한 자세한 내용은 보호 수준 이해를 참조하세요.

이러한 값이 설정된 범위는 다음과 같습니다.

ServiceContractAttribute.ProtectionLevel

OperationContractAttribute.ProtectionLevel

FaultContractAttribute.ProtectionLevel

MessageContractAttribute.ProtectionLevel

의 속성System.ServiceModel.MessageHeaderAttribute입니다MessageContractMemberAttribute.ProtectionLevel.

의 속성System.ServiceModel.MessageBodyMemberAttribute입니다MessageContractMemberAttribute.ProtectionLevel.

계약에 명시적으로 지정된 보호 수준이 없고 기본 바인딩이 보안(전송 또는 메시지 수준)을 지원하는 경우 전체 계약에 대한 효과적인 보호 수준이 됩니다 ProtectionLevel.EncryptAndSign. 바인딩이 보안(예: BasicHttpBinding)을 지원하지 않는 경우 유효 System.Net.Security.ProtectionLevelProtectionLevel.None 전체 계약에 대한 것입니다. 결과적으로 엔드포인트 바인딩에 따라 계약이 지정한 경우에도 클라이언트에서 다른 메시지 또는 전송 수준 보안 보호가 필요할 수 있습니다 ProtectionLevel.None.

적용 대상