Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Made the Nonce class's constructors and a couple of properties internal.
Browse files Browse the repository at this point in the history
This is a breaking change from v1.0, but they really shouldn't have been public in the first place.  It's doubtful that anyone needs these members, which is why they should be removed and why they can be removed.
  • Loading branch information
AArnott committed Apr 4, 2008
1 parent 44d291b commit bbbcdd2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DotNetOpenId/Nonce.cs
Expand Up @@ -24,7 +24,7 @@ public class Nonce {
AllowedCharacters[i++] = j;
}

public Nonce() : this(DateTime.UtcNow, generateUniqueFragment(), false) { }
internal Nonce() : this(DateTime.UtcNow, generateUniqueFragment(), false) { }
/// <summary>
/// Deserializes a nonce from a string passed to us.
/// </summary>
Expand All @@ -34,7 +34,7 @@ public class Nonce {
/// 2005-05-15T17:11:51ZUNIQUE
/// </param>
/// <param name="remoteServerOrigin"></param>
public Nonce(string code, bool remoteServerOrigin) {
internal Nonce(string code, bool remoteServerOrigin) {
if (string.IsNullOrEmpty(code)) throw new ArgumentNullException("code");
Code = code;
int indexOfDateEnd = code.IndexOf("Z", StringComparison.Ordinal);
Expand All @@ -51,7 +51,7 @@ public class Nonce {
}

public string Code { get; internal set; }
public DateTime CreationDate { get; internal set; }
internal DateTime CreationDate { get; set; }
internal string UniqueFragment { get; set; }
bool remoteServerOrigin;
TimeSpan maximumLifetime {
Expand All @@ -62,7 +62,7 @@ public class Nonce {
}
}

public TimeSpan Age { get { return DateTime.UtcNow - CreationDate.ToUniversalTime(); } }
internal TimeSpan Age { get { return DateTime.UtcNow - CreationDate.ToUniversalTime(); } }
public bool IsExpired { get { return Age > maximumLifetime; } }
/// <summary>
/// Gets the date past which this nonce is no longer valid, so storing a nonce for replay attack
Expand Down

0 comments on commit bbbcdd2

Please sign in to comment.