internal static void AddTo(this ChannelBindingMessageProperty channelBindingProperty, Message message)
        {
            if (message == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(message));
            }

            channelBindingProperty.AddTo(message.Properties);
        }
        internal static bool TryGet(Message message, out ChannelBindingMessageProperty property)
        {
            if (message == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(message));
            }

            return(TryGet(message.Properties, out property));
        }
        internal static void AddTo(this ChannelBindingMessageProperty channelBindingProperty, MessageProperties properties)
        {
            // Throws if disposed
            System.Security.Authentication.ExtendedProtection.ChannelBinding dummy = channelBindingProperty.ChannelBinding;
            if (properties == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(properties));
            }

            properties.Add(ChannelBindingMessageProperty.Name, channelBindingProperty);
        }
Exemple #4
0
        internal static void AddTo(this ChannelBindingMessageProperty channelBindingProperty, MessageProperties properties)
        {
            // Throws if disposed
            var dummy = channelBindingProperty.ChannelBinding;

            if (properties == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("properties");
            }

            properties.Add(ChannelBindingMessageProperty.Name, channelBindingProperty);
        }
        public ChannelBinding GetChannelBinding()
        {
            if (this.message == null)
            {
                return(null);
            }
            ChannelBindingMessageProperty property = null;

            ChannelBindingMessageProperty.TryGet(this.message, out property);
            ChannelBinding channelBinding = null;

            if (property != null)
            {
                channelBinding = property.ChannelBinding;
            }
            return(channelBinding);
        }
        internal static bool TryGet(MessageProperties properties, out ChannelBindingMessageProperty property)
        {
            if (properties == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(properties));
            }

            property = null;

            if (properties.TryGetValue(ChannelBindingMessageProperty.Name, out object value))
            {
                property = value as ChannelBindingMessageProperty;
                return(property != null);
            }

            return(false);
        }
Exemple #7
0
        public ChannelBinding GetChannelBinding()
        {
            if (Message == null)
            {
                return(null);
            }

            ChannelBindingMessageProperty.TryGet(Message, out ChannelBindingMessageProperty channelBindingMessageProperty);
            ChannelBinding channelBinding = null;

            if (channelBindingMessageProperty != null)
            {
                channelBinding = channelBindingMessageProperty.ChannelBinding;
            }

            return(channelBinding);
        }
Exemple #8
0
        private void AttachChannelBindingTokenIfFound()
        {
            ChannelBindingMessageProperty property = null;

            ChannelBindingMessageProperty.TryGet(base.InnerMessage, out property);
            if (((property != null) && (this.securityHeader.ElementContainer != null)) && (this.securityHeader.ElementContainer.EndorsingSupportingTokens != null))
            {
                foreach (SecurityToken token in this.securityHeader.ElementContainer.EndorsingSupportingTokens)
                {
                    ProviderBackedSecurityToken token2 = token as ProviderBackedSecurityToken;
                    if (token2 != null)
                    {
                        token2.ChannelBinding = property.ChannelBinding;
                    }
                }
            }
        }
        private void AttachChannelBindingTokenIfFound()
        {
            ChannelBindingMessageProperty.TryGet(InnerMessage, out ChannelBindingMessageProperty cbmp);

            if (cbmp != null)
            {
                if (_securityHeader.ElementContainer != null && _securityHeader.ElementContainer.EndorsingSupportingTokens != null)
                {
                    foreach (SecurityToken token in _securityHeader.ElementContainer.EndorsingSupportingTokens)
                    {
                        if (token is ProviderBackedSecurityToken pbst)
                        {
                            pbst.ChannelBinding = cbmp.ChannelBinding;
                        }
                    }
                }
            }
        }
        private void AttachChannelBindingTokenIfFound()
        {
            ChannelBindingMessageProperty cbmp = null;

            ChannelBindingMessageProperty.TryGet(this.InnerMessage, out cbmp);

            if (cbmp != null)
            {
                if (this.securityHeader.ElementContainer != null && this.securityHeader.ElementContainer.EndorsingSupportingTokens != null)
                {
                    foreach (SecurityToken token in this.securityHeader.ElementContainer.EndorsingSupportingTokens)
                    {
                        ProviderBackedSecurityToken pbst = token as ProviderBackedSecurityToken;
                        if (pbst != null)
                        {
                            pbst.ChannelBinding = cbmp.ChannelBinding;
                        }
                    }
                }
            }
        }