diff options
Diffstat (limited to 'src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs')
-rw-r--r-- | src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs b/src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs deleted file mode 100644 index 97298ad..0000000 --- a/src/DotNetOAuth.Test/Mocks/MockSigningBindingElement.cs +++ /dev/null @@ -1,48 +0,0 @@ -//-----------------------------------------------------------------------
-// <copyright file="MockSigningBindingElement.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace DotNetOAuth.Test.Mocks {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using DotNetOAuth.Messaging;
- using DotNetOAuth.Messaging.Bindings;
-
- internal class MockSigningBindingElement : IChannelBindingElement {
- internal const string MessageSignature = "mocksignature";
-
- #region IChannelBindingElement Members
-
- MessageProtections IChannelBindingElement.Protection {
- get { return MessageProtections.TamperProtection; }
- }
-
- bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) {
- ITamperResistantProtocolMessage signedMessage = message as ITamperResistantProtocolMessage;
- if (signedMessage != null) {
- signedMessage.Signature = MessageSignature;
- return true;
- }
-
- return false;
- }
-
- bool IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) {
- ITamperResistantProtocolMessage signedMessage = message as ITamperResistantProtocolMessage;
- if (signedMessage != null) {
- if (signedMessage.Signature != MessageSignature) {
- throw new InvalidSignatureException(message);
- }
- return true;
- }
-
- return false;
- }
-
- #endregion
- }
-}
|