This project is read-only.

How to Control the Level of Message Encryption

- J.D. Meier, Carlos Farre, Jason Taylor, Prashant Bansode, Steve Gregersen, Madhu Sundararajan, Rob Boucher

If you are using message security, then use the ServiceContract(ProtectionLevel) attribute to specify message security protection levels on the interface or operation level.

The protection level options available are:
  • None. Use None to turn off signing and encryption on the operation or interface.
  • Sign. Use Sign to sign the interface or operation but not encrypt it.
  • EncryptAndSign. Use EncryptAndSign to both encrypt and sign the interface or operation.

If you are using transport security, you cannot partially encrypt your messages.
  1. Use the following step to create of an interface with protection level set to Sign.
[ServiceContract(ProtectionLevel=ProtectionLevel.Sign]
public interface IService
{	
	string GetData(int value);	
}
  1. Use the following step for of an operation with protection level set to Sign.
[OperationContract(ProtectionLevel=ProtectionLevel.Sign]
string GetData(int value);

Additional Resources

Last edited Jun 13, 2008 at 9:15 PM by prashantbansode, version 1

Comments

No comments yet.