Export (0) Print
Expand All

Message.UseEncryption Property

Gets or sets a value that indicates whether to make the message private.

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

[MessagingDescriptionAttribute("MsgUseEncryption")]
public bool UseEncryption { get; set; }

Property Value

Type: System.Boolean
true to require Message Queuing to encrypt the message; otherwise, false. The default is false.

ExceptionCondition
InvalidOperationException

The message queue is filtered to ignore the UseEncryption property.

If a message is private, its body is encrypted before it is sent and decrypted when it is received. To send a private message, the sending application must specify that encryption be used and, optionally, the encryption algorithm.

When sending private messages, your application does not need to perform the message encryption. Message Queuing can encrypt the message body for you if your application is sending messages within a Microsoft Windows 2000 enterprise, which has access to the directory service. When receiving private messages, the receiving Queue Manager always decrypts the message body.

The following code example gets and sets the value of a message's UseEncryption property.

// Set the message's UseEncryption property.
orderMessage.UseEncryption = true;

// Display the new value of the message's UseEncryption property.
Console.WriteLine("Message.UseEncryption: {0}",
    orderMessage.UseEncryption);

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft