summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-03-21 22:58:36 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2012-03-21 22:58:36 -0700
commit80028b1c5442c85909b889b3c52cfbd0c0121437 (patch)
treeb1b651c08a349957bb3d26ad5234a266d8d3e42e /src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs
parentf02ccf1e93367b7ab8bece3a2c53e960e98d221d (diff)
parente1455ee979b150d1ea4afdf1bc82a9e5cbc5b2ba (diff)
downloadDotNetOpenAuth-80028b1c5442c85909b889b3c52cfbd0c0121437.zip
DotNetOpenAuth-80028b1c5442c85909b889b3c52cfbd0c0121437.tar.gz
DotNetOpenAuth-80028b1c5442c85909b889b3c52cfbd0c0121437.tar.bz2
Merge branch 'v4.0' into dev11
Conflicts: src/DotNetOpenAuth.sln
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs')
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs b/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs
index 43df1f5..9d4b93e 100644
--- a/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs
@@ -110,7 +110,7 @@ namespace DotNetOpenAuth.Messaging {
/// <param name="decodeOnceOnly">The nonce store to use to ensure that this instance is only decoded once.</param>
protected DataBagFormatterBase(ICryptoKeyStore cryptoKeyStore = null, string bucket = null, bool signed = false, bool encrypted = false, bool compressed = false, TimeSpan? minimumAge = null, TimeSpan? maximumAge = null, INonceStore decodeOnceOnly = null)
: this(signed, encrypted, compressed, maximumAge, decodeOnceOnly) {
- Requires.True(!String.IsNullOrEmpty(bucket) || cryptoKeyStore == null, null);
+ Requires.True(!string.IsNullOrEmpty(bucket) || cryptoKeyStore == null, null);
Requires.True(cryptoKeyStore != null || (!signed && !encrypted), null);
this.cryptoKeyStore = cryptoKeyStore;
@@ -190,15 +190,22 @@ namespace DotNetOpenAuth.Messaging {
/// <summary>
/// Deserializes a <see cref="DataBag"/>, including decompression, decryption, signature and nonce validation where applicable.
/// </summary>
- /// <param name="containingMessage">The message that contains the <see cref="DataBag"/> serialized value. Must not be nulll.</param>
+ /// <param name="containingMessage">The message that contains the <see cref="DataBag"/> serialized value. Must not be null.</param>
/// <param name="value">The serialized form of the <see cref="DataBag"/> to deserialize. Must not be null or empty.</param>
- /// <returns>The deserialized value. Never null.</returns>
+ /// <param name="messagePartName">The name of the parameter whose value is to be deserialized. Used for error message generation.</param>
+ /// <returns>
+ /// The deserialized value. Never null.
+ /// </returns>
[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "No apparent problem. False positive?")]
- public T Deserialize(IProtocolMessage containingMessage, string value) {
+ public T Deserialize(IProtocolMessage containingMessage, string value, string messagePartName) {
+ Requires.NotNull(containingMessage, "containingMessage");
+ Requires.NotNullOrEmpty(value, "value");
+ Requires.NotNullOrEmpty(messagePartName, "messagePartName");
+
string symmetricSecretHandle = null;
if (this.encrypted && this.cryptoKeyStore != null) {
string valueWithoutHandle;
- MessagingUtilities.ExtractKeyHandleAndPayload(containingMessage, "<TODO>", value, out symmetricSecretHandle, out valueWithoutHandle);
+ MessagingUtilities.ExtractKeyHandleAndPayload(containingMessage, messagePartName, value, out symmetricSecretHandle, out valueWithoutHandle);
value = valueWithoutHandle;
}