summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core/Messaging/MessageProtections.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/MessageProtections.cs')
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/MessageProtections.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/MessageProtections.cs b/src/DotNetOpenAuth.Core/Messaging/MessageProtections.cs
new file mode 100644
index 0000000..c78c92f
--- /dev/null
+++ b/src/DotNetOpenAuth.Core/Messaging/MessageProtections.cs
@@ -0,0 +1,46 @@
+//-----------------------------------------------------------------------
+// <copyright file="MessageProtections.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Messaging {
+ using System;
+
+ /// <summary>
+ /// Categorizes the various types of channel binding elements so they can be properly ordered.
+ /// </summary>
+ /// <remarks>
+ /// The order of these enum values is significant.
+ /// Each successive value requires the protection offered by all the previous values
+ /// in order to be reliable. For example, message expiration is meaningless without
+ /// tamper protection to prevent a user from changing the timestamp on a message.
+ /// </remarks>
+ [Flags]
+ public enum MessageProtections {
+ /// <summary>
+ /// No protection.
+ /// </summary>
+ None = 0x0,
+
+ /// <summary>
+ /// A binding element that signs a message before sending and validates its signature upon receiving.
+ /// </summary>
+ TamperProtection = 0x1,
+
+ /// <summary>
+ /// A binding element that enforces a maximum message age between sending and processing on the receiving side.
+ /// </summary>
+ Expiration = 0x2,
+
+ /// <summary>
+ /// A binding element that prepares messages for replay detection and detects replayed messages on the receiving side.
+ /// </summary>
+ ReplayProtection = 0x4,
+
+ /// <summary>
+ /// All forms of protection together.
+ /// </summary>
+ All = TamperProtection | Expiration | ReplayProtection,
+ }
+} \ No newline at end of file