summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core/Messaging
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging')
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs6
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/DataBag.cs2
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/IStreamSerializingDataBag.cs27
3 files changed, 4 insertions, 31 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs b/src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs
index 4cb5337..42eea15 100644
--- a/src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs
@@ -138,9 +138,9 @@ namespace DotNetOpenAuth.Messaging.Bindings {
/// <param name="decrypted">The decrypted key.</param>
internal CachedCryptoKey(CryptoKey encrypted, CryptoKey decrypted)
: base(decrypted.Key, decrypted.ExpiresUtc) {
- Contract.Requires(encrypted != null);
- Contract.Requires(decrypted != null);
- Contract.Requires(encrypted.ExpiresUtc == decrypted.ExpiresUtc);
+ Requires.NotNull(encrypted, "encrypted");
+ Requires.NotNull(decrypted, "decrypted");
+ Requires.True(encrypted.ExpiresUtc == decrypted.ExpiresUtc);
this.EncryptedKey = encrypted.Key;
}
diff --git a/src/DotNetOpenAuth.Core/Messaging/DataBag.cs b/src/DotNetOpenAuth.Core/Messaging/DataBag.cs
index 0800840..cdf4033 100644
--- a/src/DotNetOpenAuth.Core/Messaging/DataBag.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/DataBag.cs
@@ -42,7 +42,7 @@ namespace DotNetOpenAuth.Messaging {
/// </summary>
/// <param name="version">The DataBag version.</param>
protected DataBag(Version version) {
- Contract.Requires(version != null);
+ Requires.NotNull(version, "version");
this.version = version;
}
diff --git a/src/DotNetOpenAuth.Core/Messaging/IStreamSerializingDataBag.cs b/src/DotNetOpenAuth.Core/Messaging/IStreamSerializingDataBag.cs
index cc82d6a..42608f4 100644
--- a/src/DotNetOpenAuth.Core/Messaging/IStreamSerializingDataBag.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/IStreamSerializingDataBag.cs
@@ -12,7 +12,6 @@ namespace DotNetOpenAuth.Messaging {
/// <summary>
/// An interface implemented by <see cref="DataBag"/>-derived types that support binary serialization.
/// </summary>
- [ContractClass(typeof(IStreamSerializingDataBaContract))]
internal interface IStreamSerializingDataBag {
/// <summary>
/// Serializes the instance to the specified stream.
@@ -26,30 +25,4 @@ namespace DotNetOpenAuth.Messaging {
/// <param name="stream">The stream.</param>
void Deserialize(Stream stream);
}
-
- /// <summary>
- /// Code Contract for the <see cref="IStreamSerializingDataBag"/> interface.
- /// </summary>
- [ContractClassFor(typeof(IStreamSerializingDataBag))]
- internal abstract class IStreamSerializingDataBaContract : IStreamSerializingDataBag {
- /// <summary>
- /// Serializes the instance to the specified stream.
- /// </summary>
- /// <param name="stream">The stream.</param>
- void IStreamSerializingDataBag.Serialize(Stream stream) {
- Contract.Requires(stream != null);
- Contract.Requires(stream.CanWrite);
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Initializes the fields on this instance from the specified stream.
- /// </summary>
- /// <param name="stream">The stream.</param>
- void IStreamSerializingDataBag.Deserialize(Stream stream) {
- Contract.Requires(stream != null);
- Contract.Requires(stream.CanRead);
- throw new NotImplementedException();
- }
- }
}