SymmetricSecurityBindingElement.MessageProtectionOrder Propriedade

Definição

Obtém ou define a ordem de criptografia e assinatura de mensagem para essa associação.

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

Valor da propriedade

MessageProtectionOrder

O MessageProtectionOrder que especifica como a mensagem é protegida. O padrão é SignBeforeEncrypt.

Exceções

set e value são indefinidos.

Exemplos

O código a seguir mostra como definir essa propriedade.

// 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;

Comentários

Observação

Se não houver nada na mensagem criptografada, o elemento de assinatura não será criptografado mesmo quando a MessageProtectionOrder propriedade estiver definida como SignBeforeEncryptAndEncryptSignature. Esse comportamento ocorre mesmo com associações fornecidas pelo sistema. No entanto, o WSDL gerado pelo WCF ainda contém a declaração <sp:EncryptSignature> .

Para obter uma listagem dos membros e suas descrições, consulte MessageProtectionOrder.

Aplica-se a