public override int GetHashCode() { int result = 1; result = (result * 397) ^ (Browser != null ? Browser.GetHashCode() : 0); result = (result * 397) ^ (BrowserVersion != null ? BrowserVersion.GetHashCode() : 0); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ LoginDate.GetHashCode(); result = (result * 397) ^ (Username != null ? Username.GetHashCode() : 0); return(result); }
public bool IsValid(string xmlRSAKey, int tokenDuration) { string TempSignedData = AsymmetricCryptography.SignData(MakePayLoad(ClientID, LoginDate, ExpireDate), xmlRSAKey); return((TempSignedData == SignedData) && (LoginDate.AddMinutes(tokenDuration) < ExpireDate)); }