Ejemplo n.º 1
0
 private PeerTransportBindingElement(PeerTransportBindingElement elementToBeCloned) : base(elementToBeCloned)
 {
     this.listenIPAddress = elementToBeCloned.listenIPAddress;
     this.port            = elementToBeCloned.port;
     this.resolverSet     = elementToBeCloned.resolverSet;
     this.resolver        = elementToBeCloned.resolver;
     this.peerSecurity    = new PeerSecuritySettings(elementToBeCloned.Security);
 }
Ejemplo n.º 2
0
        static public PeerSecurityManager Create(PeerSecuritySettings security, BindingContext context, XmlDictionaryReaderQuotas readerQuotas)
        {
            PeerAuthenticationMode authMode = PeerAuthenticationMode.None;
            bool signing = false;

            Convert(security, out authMode, out signing);
            return(Create(authMode, signing, context, readerQuotas));
        }
Ejemplo n.º 3
0
 public PeerTransportBindingElement()
 {
     this.listenIPAddress = null;
     this.port            = 0;
     if (PeerTransportDefaults.ResolverAvailable)
     {
         this.resolver = PeerTransportDefaults.CreateResolver();
     }
     this.peerSecurity = new PeerSecuritySettings();
 }
 internal void InitializeFrom(PeerSecuritySettings security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     SetPropertyValueIfNotDefaultValue(ConfigurationStrings.Mode, security.Mode);
     if (security.Mode != SecurityMode.None)
     {
         this.Transport.InitializeFrom(security.Transport);
     }
 }
 internal void ApplyConfiguration(PeerSecuritySettings security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     security.Mode = this.Mode;
     if (security.Mode != SecurityMode.None)
     {
         this.Transport.ApplyConfiguration(security.Transport);
     }
 }
Ejemplo n.º 6
0
 internal void InitializeFrom(PeerSecuritySettings security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     this.Mode = security.Mode;
     if (security.Mode != SecurityMode.None)
     {
         this.Transport.InitializeFrom(security.Transport);
     }
 }
Ejemplo n.º 7
0
        static void Convert(PeerSecuritySettings security, out PeerAuthenticationMode authMode, out bool signing)
        {
            authMode = PeerAuthenticationMode.None;
            signing  = false;
            if (security.Mode == SecurityMode.Transport || security.Mode == SecurityMode.TransportWithMessageCredential)
            {
                switch (security.Transport.CredentialType)
                {
                case PeerTransportCredentialType.Password:
                    authMode = PeerAuthenticationMode.Password;
                    break;

                case PeerTransportCredentialType.Certificate:
                    authMode = PeerAuthenticationMode.MutualCertificate;
                    break;
                }
            }
            if (security.Mode == SecurityMode.Message || security.Mode == SecurityMode.TransportWithMessageCredential)
            {
                signing = true;
            }
        }