public void ProcessRstr(IPeerNeighbor neighbor, Message message, Claim claim) { PeerHashToken token = PeerRequestSecurityTokenResponse.CreateHashTokenFrom(message); if (!token.IsValid) { this.OnFailed(neighbor); } else if (!this.securityManager.GetExpectedTokenForClaim(claim).Equals(token)) { this.OnFailed(neighbor); } else { this.OnAuthenticated(); } }
public static bool AuthenticateResponse(Claim claim, string password, Message message) { return(PeerRequestSecurityTokenResponse.CreateHashTokenFrom(message).Validate(claim, password)); }