summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs b/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs
index 5890d93..449b3ca 100644
--- a/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs
+++ b/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs
@@ -7,11 +7,11 @@
namespace DotNetOpenAuth.OAuth2 {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.Security.Cryptography;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OAuth2.ChannelElements;
+ using Validation;
/// <summary>
/// A short-lived token that accompanies HTTP requests to protected data to authorize the request.
@@ -51,9 +51,8 @@ namespace DotNetOpenAuth.OAuth2 {
/// <param name="encryptingKey">The crypto service provider with the resource server's public key used to encrypt the access token.</param>
/// <returns>An access token serializer.</returns>
internal static IDataBagFormatter<AccessToken> CreateFormatter(RSACryptoServiceProvider signingKey, RSACryptoServiceProvider encryptingKey) {
- Contract.Requires(signingKey != null || !signingKey.PublicOnly);
- Contract.Requires(encryptingKey != null);
- Contract.Ensures(Contract.Result<IDataBagFormatter<AccessToken>>() != null);
+ Requires.That(signingKey == null || !signingKey.PublicOnly, "signingKey", "requires private key");
+ Requires.NotNull(encryptingKey, "encryptingKey");
return new UriStyleMessageFormatter<AccessToken>(signingKey, encryptingKey);
}
@@ -94,7 +93,6 @@ namespace DotNetOpenAuth.OAuth2 {
/// </summary>
/// <returns>A non-empty string.</returns>
protected internal virtual string Serialize() {
- Contract.Ensures(!string.IsNullOrEmpty(Contract.Result<string>()));
throw new NotSupportedException();
}