Example #1
0
        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();
            }
        }
Example #2
0
 public static bool AuthenticateResponse(Claim claim, string password, Message message)
 {
     return(PeerRequestSecurityTokenResponse.CreateHashTokenFrom(message).Validate(claim, password));
 }