Exemple #1
0
        public void CheckIfCompatibleNodeSettings(object other)
        {
            string mismatch          = null;
            PeerSecurityManager that = other as PeerSecurityManager;

            if (that == null)
            {
                mismatch = PeerBindingPropertyNames.Security;
            }
            else if (this.authenticationMode != that.authenticationMode)
            {
                mismatch = PeerBindingPropertyNames.SecurityDotMode;
            }
            else if (this.authenticationMode == PeerAuthenticationMode.None)
            {
                return;
            }
            else if (!this.tokenManager.Equals(that.tokenManager))
            {
                if (this.credManager != null)
                {
                    this.credManager.CheckIfCompatible(that.credManager);
                }
                else
                {
                    Fx.Assert(typeof(PeerSecurityCredentialsManager.PeerClientSecurityTokenManager).IsAssignableFrom(tokenManager.GetType()), "");
                    mismatch = PeerBindingPropertyNames.Credentials;
                }
            }
            if (mismatch != null)
            {
                PeerExceptionHelper.ThrowInvalidOperation_PeerConflictingPeerNodeSettings(mismatch);
            }
        }
 public void CheckIfCompatible(PeerSecurityCredentialsManager that)
 {
     if (that == null)
     {
         PeerExceptionHelper.ThrowInvalidOperation_PeerConflictingPeerNodeSettings(PeerBindingPropertyNames.Credentials);
     }
     if (this.mode != PeerAuthenticationMode.None)
     {
         if ((this.mode == PeerAuthenticationMode.Password) && (this.Password != that.Password))
         {
             PeerExceptionHelper.ThrowInvalidOperation_PeerConflictingPeerNodeSettings(PeerBindingPropertyNames.Password);
         }
         if (!this.Certificate.Equals((X509Certificate)that.Certificate))
         {
             PeerExceptionHelper.ThrowInvalidOperation_PeerConflictingPeerNodeSettings(PeerBindingPropertyNames.Certificate);
         }
     }
 }
Exemple #3
0
        public void CheckIfCompatibleNodeSettings(object other)
        {
            string propertyName         = null;
            PeerSecurityManager manager = other as PeerSecurityManager;

            if (manager == null)
            {
                propertyName = PeerBindingPropertyNames.Security;
            }
            else if (this.authenticationMode != manager.authenticationMode)
            {
                propertyName = PeerBindingPropertyNames.SecurityDotMode;
            }
            else
            {
                if (this.authenticationMode == PeerAuthenticationMode.None)
                {
                    return;
                }
                if (!this.tokenManager.Equals(manager.tokenManager))
                {
                    if (this.credManager != null)
                    {
                        this.credManager.CheckIfCompatible(manager.credManager);
                    }
                    else
                    {
                        propertyName = PeerBindingPropertyNames.Credentials;
                    }
                }
            }
            if (propertyName != null)
            {
                PeerExceptionHelper.ThrowInvalidOperation_PeerConflictingPeerNodeSettings(propertyName);
            }
        }