diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-12-26 18:07:32 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-12-26 18:07:32 -0800 |
commit | 002ce0e39af3b684ce6060dce60805e3333420fa (patch) | |
tree | 2c9aace23e08d17ed03a3732a5fa4a549463f811 /src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs | |
parent | 4bf6dfa05ab5ba2d7ebff157dc4a1a85dae42125 (diff) | |
download | DotNetOpenAuth-002ce0e39af3b684ce6060dce60805e3333420fa.zip DotNetOpenAuth-002ce0e39af3b684ce6060dce60805e3333420fa.tar.gz DotNetOpenAuth-002ce0e39af3b684ce6060dce60805e3333420fa.tar.bz2 |
Replaces DNOA's internal Requires class with Validation NuGet package.
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs')
-rw-r--r-- | src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs b/src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs index 42eea15..edf62c4 100644 --- a/src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs +++ b/src/DotNetOpenAuth.Core/Messaging/Bindings/AsymmetricCryptoKeyStoreWrapper.cs @@ -13,6 +13,7 @@ namespace DotNetOpenAuth.Messaging.Bindings { using System.Security.Cryptography; using System.Text; using DotNetOpenAuth.Messaging; + using Validation; /// <summary> /// Provides RSA encryption of symmetric keys to protect them from a theft of @@ -42,7 +43,7 @@ namespace DotNetOpenAuth.Messaging.Bindings { public AsymmetricCryptoKeyStoreWrapper(ICryptoKeyStore dataStore, RSACryptoServiceProvider asymmetricCrypto) { Requires.NotNull(dataStore, "dataStore"); Requires.NotNull(asymmetricCrypto, "asymmetricCrypto"); - Requires.True(!asymmetricCrypto.PublicOnly, "asymmetricCrypto"); + Requires.That(!asymmetricCrypto.PublicOnly, "asymmetricCrypto", "Private key required."); this.dataStore = dataStore; this.asymmetricCrypto = asymmetricCrypto; } @@ -140,7 +141,7 @@ namespace DotNetOpenAuth.Messaging.Bindings { : base(decrypted.Key, decrypted.ExpiresUtc) { Requires.NotNull(encrypted, "encrypted"); Requires.NotNull(decrypted, "decrypted"); - Requires.True(encrypted.ExpiresUtc == decrypted.ExpiresUtc); + Requires.That(encrypted.ExpiresUtc == decrypted.ExpiresUtc, "encrypted", "encrypted and decrypted expirations must equal."); this.EncryptedKey = encrypted.Key; } |