summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Messaging/ChannelProtection.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-13 13:42:46 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-13 13:42:46 -0700
commitf665e1e639319918385fcc8397f8c0d5009e3bdd (patch)
tree6219f476ab24bc187eac79b501d7de73c9acd234 /src/DotNetOAuth/Messaging/ChannelProtection.cs
parent61650a6ec207c94cb92e27227dac75606c3e7e00 (diff)
downloadDotNetOpenAuth-f665e1e639319918385fcc8397f8c0d5009e3bdd.zip
DotNetOpenAuth-f665e1e639319918385fcc8397f8c0d5009e3bdd.tar.gz
DotNetOpenAuth-f665e1e639319918385fcc8397f8c0d5009e3bdd.tar.bz2
Totally refactored signing, expiration and replay detection into extensible channel binding elements.
Diffstat (limited to 'src/DotNetOAuth/Messaging/ChannelProtection.cs')
-rw-r--r--src/DotNetOAuth/Messaging/ChannelProtection.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/DotNetOAuth/Messaging/ChannelProtection.cs b/src/DotNetOAuth/Messaging/ChannelProtection.cs
new file mode 100644
index 0000000..bbc619c
--- /dev/null
+++ b/src/DotNetOAuth/Messaging/ChannelProtection.cs
@@ -0,0 +1,41 @@
+//-----------------------------------------------------------------------
+// <copyright file="ChannelProtection.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOAuth.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]
+ internal enum ChannelProtection {
+ /// <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,
+ }
+} \ No newline at end of file