//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Messaging {
using System;
using System.Diagnostics.Contracts;
using DotNetOpenAuth.OAuth.ChannelElements;
///
/// An interface that must be implemented by message transforms/validators in order
/// to be included in the channel stack.
///
[ContractClass(typeof(ITamperProtectionChannelBindingElementContract))]
public interface ITamperProtectionChannelBindingElement : IChannelBindingElement {
///
/// Gets or sets the delegate that will initialize the non-serialized properties necessary on a
/// signable message so that its signature can be correctly calculated or verified.
///
Action SignatureCallback { get; set; }
///
/// Clones this instance.
///
/// The cloned instance.
ITamperProtectionChannelBindingElement Clone();
}
///
/// Contract class for the interface.
///
[ContractClassFor(typeof(ITamperProtectionChannelBindingElement))]
internal abstract class ITamperProtectionChannelBindingElementContract : ITamperProtectionChannelBindingElement {
#region ITamperProtectionChannelBindingElement Properties
///
/// Gets or sets the delegate that will initialize the non-serialized properties necessary on a
/// signable message so that its signature can be correctly calculated or verified.
///
Action ITamperProtectionChannelBindingElement.SignatureCallback {
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
#endregion
#region IChannelBindingElement Members
///
/// Gets or sets the channel that this binding element belongs to.
///
///
/// This property is set by the channel when it is first constructed.
///
Channel IChannelBindingElement.Channel {
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
///
/// Gets the protection commonly offered (if any) by this binding element.
///
///
/// This value is used to assist in sorting binding elements in the channel stack.
///
MessageProtections IChannelBindingElement.Protection {
get { throw new NotImplementedException(); }
}
///
/// Prepares a message for sending based on the rules of this channel binding element.
///
/// The message to prepare for sending.
///
/// The protections (if any) that this binding element applied to the message.
/// Null if this binding element did not even apply to this binding element.
///
///
/// Implementations that provide message protection must honor the
/// properties where applicable.
///
MessageProtections? IChannelBindingElement.ProcessOutgoingMessage(IProtocolMessage message) {
throw new NotImplementedException();
}
///
/// Performs any transformation on an incoming message that may be necessary and/or
/// validates an incoming message based on the rules of this channel binding element.
///
/// The incoming message to process.
///
/// The protections (if any) that this binding element applied to the message.
/// Null if this binding element did not even apply to this binding element.
///
///
/// Thrown when the binding element rules indicate that this message is invalid and should
/// NOT be processed.
///
///
/// Implementations that provide message protection must honor the
/// properties where applicable.
///
MessageProtections? IChannelBindingElement.ProcessIncomingMessage(IProtocolMessage message) {
throw new NotImplementedException();
}
#endregion
#region ITamperProtectionChannelBindingElement Methods
///
/// Clones this instance.
///
/// The cloned instance.
ITamperProtectionChannelBindingElement ITamperProtectionChannelBindingElement.Clone() {
Contract.Ensures(Contract.Result() != null);
throw new NotImplementedException();
}
#endregion
}
}