Пример #1
0
        protected override void OnWriteMessage(XmlDictionaryWriter writer)
        {
            // For Kerb one shot, the channel binding will be need to be fished out of the message, cached and added to the
            // token before calling ISC.

            AttachChannelBindingTokenIfFound();

            EnsureUniqueSecurityApplication();

            MessagePrefixGenerator prefixGenerator = new MessagePrefixGenerator(writer);

            this.securityHeader.StartSecurityApplication();

            this.Headers.Add(this.securityHeader);

            this.InnerMessage.WriteStartEnvelope(writer);

            this.Headers.RemoveAt(this.Headers.Count - 1);

            this.securityHeader.ApplyBodySecurity(writer, prefixGenerator);

            this.InnerMessage.WriteStartHeaders(writer);
            this.securityHeader.ApplySecurityAndWriteHeaders(this.Headers, writer, prefixGenerator);

            this.securityHeader.RemoveSignatureEncryptionIfAppropriate();

            this.securityHeader.CompleteSecurityApplication();
            this.securityHeader.WriteHeader(writer, this.Version);
            writer.WriteEndElement();

            if (this.fullBodyFragment != null)
            {
                ((IFragmentCapableXmlDictionaryWriter)writer).WriteFragment(this.fullBodyFragment, 0, this.fullBodyFragmentLength);
            }
            else
            {
                if (this.startBodyFragment != null)
                {
                    ((IFragmentCapableXmlDictionaryWriter)writer).WriteFragment(this.startBodyFragment.GetBuffer(), 0, (int)this.startBodyFragment.Length);
                }
                else
                {
                    OnWriteStartBody(writer);
                }

                OnWriteBodyContents(writer);

                if (this.endBodyFragment != null)
                {
                    ((IFragmentCapableXmlDictionaryWriter)writer).WriteFragment(this.endBodyFragment.GetBuffer(), 0, (int)this.endBodyFragment.Length);
                }
                else
                {
                    writer.WriteEndElement();
                }
            }

            writer.WriteEndElement();
        }
Пример #2
0
        protected override void OnWriteMessage(XmlDictionaryWriter writer)
        {
            this.AttachChannelBindingTokenIfFound();
            this.EnsureUniqueSecurityApplication();
            MessagePrefixGenerator prefixGenerator = new MessagePrefixGenerator(writer);

            this.securityHeader.StartSecurityApplication();
            this.Headers.Add(this.securityHeader);
            base.InnerMessage.WriteStartEnvelope(writer);
            this.Headers.RemoveAt(this.Headers.Count - 1);
            this.securityHeader.ApplyBodySecurity(writer, prefixGenerator);
            base.InnerMessage.WriteStartHeaders(writer);
            this.securityHeader.ApplySecurityAndWriteHeaders(this.Headers, writer, prefixGenerator);
            this.securityHeader.RemoveSignatureEncryptionIfAppropriate();
            this.securityHeader.CompleteSecurityApplication();
            this.securityHeader.WriteHeader(writer, this.Version);
            writer.WriteEndElement();
            if (this.fullBodyFragment != null)
            {
                ((IFragmentCapableXmlDictionaryWriter)writer).WriteFragment(this.fullBodyFragment, 0, this.fullBodyFragmentLength);
            }
            else
            {
                if (this.startBodyFragment != null)
                {
                    ((IFragmentCapableXmlDictionaryWriter)writer).WriteFragment(this.startBodyFragment.GetBuffer(), 0, (int)this.startBodyFragment.Length);
                }
                else
                {
                    this.OnWriteStartBody(writer);
                }
                this.OnWriteBodyContents(writer);
                if (this.endBodyFragment != null)
                {
                    ((IFragmentCapableXmlDictionaryWriter)writer).WriteFragment(this.endBodyFragment.GetBuffer(), 0, (int)this.endBodyFragment.Length);
                }
                else
                {
                    writer.WriteEndElement();
                }
            }
            writer.WriteEndElement();
        }
        protected override void OnWriteMessage(XmlDictionaryWriter writer)
        {
            // For Kerb one shot, the channel binding will be need to be fished out of the message, cached and added to the
            // token before calling ISC.

            AttachChannelBindingTokenIfFound();

            EnsureUniqueSecurityApplication();

            MessagePrefixGenerator prefixGenerator = new MessagePrefixGenerator(writer);
            this.securityHeader.StartSecurityApplication();

            this.Headers.Add(this.securityHeader);

            this.InnerMessage.WriteStartEnvelope(writer);

            this.Headers.RemoveAt(this.Headers.Count - 1);

            this.securityHeader.ApplyBodySecurity(writer, prefixGenerator);

            this.InnerMessage.WriteStartHeaders(writer);
            this.securityHeader.ApplySecurityAndWriteHeaders(this.Headers, writer, prefixGenerator);

            this.securityHeader.RemoveSignatureEncryptionIfAppropriate();

            this.securityHeader.CompleteSecurityApplication();
            this.securityHeader.WriteHeader(writer, this.Version);
            writer.WriteEndElement();

            if (this.fullBodyFragment != null)
            {
                ((IFragmentCapableXmlDictionaryWriter) writer).WriteFragment(this.fullBodyFragment, 0, this.fullBodyFragmentLength);
            }
            else
            {
                if (this.startBodyFragment != null)
                {
                    ((IFragmentCapableXmlDictionaryWriter) writer).WriteFragment(this.startBodyFragment.GetBuffer(), 0, (int) this.startBodyFragment.Length);
                }
                else
                {
                    OnWriteStartBody(writer);
                }

                OnWriteBodyContents(writer);

                if (this.endBodyFragment != null)
                {
                    ((IFragmentCapableXmlDictionaryWriter) writer).WriteFragment(this.endBodyFragment.GetBuffer(), 0, (int) this.endBodyFragment.Length);
                }
                else
                {
                    writer.WriteEndElement();
                }
            }

            writer.WriteEndElement();
        }
 protected override void OnWriteMessage(XmlDictionaryWriter writer)
 {
     this.AttachChannelBindingTokenIfFound();
     this.EnsureUniqueSecurityApplication();
     MessagePrefixGenerator prefixGenerator = new MessagePrefixGenerator(writer);
     this.securityHeader.StartSecurityApplication();
     this.Headers.Add(this.securityHeader);
     base.InnerMessage.WriteStartEnvelope(writer);
     this.Headers.RemoveAt(this.Headers.Count - 1);
     this.securityHeader.ApplyBodySecurity(writer, prefixGenerator);
     base.InnerMessage.WriteStartHeaders(writer);
     this.securityHeader.ApplySecurityAndWriteHeaders(this.Headers, writer, prefixGenerator);
     this.securityHeader.RemoveSignatureEncryptionIfAppropriate();
     this.securityHeader.CompleteSecurityApplication();
     this.securityHeader.WriteHeader(writer, this.Version);
     writer.WriteEndElement();
     if (this.fullBodyFragment != null)
     {
         ((IFragmentCapableXmlDictionaryWriter) writer).WriteFragment(this.fullBodyFragment, 0, this.fullBodyFragmentLength);
     }
     else
     {
         if (this.startBodyFragment != null)
         {
             ((IFragmentCapableXmlDictionaryWriter) writer).WriteFragment(this.startBodyFragment.GetBuffer(), 0, (int) this.startBodyFragment.Length);
         }
         else
         {
             this.OnWriteStartBody(writer);
         }
         this.OnWriteBodyContents(writer);
         if (this.endBodyFragment != null)
         {
             ((IFragmentCapableXmlDictionaryWriter) writer).WriteFragment(this.endBodyFragment.GetBuffer(), 0, (int) this.endBodyFragment.Length);
         }
         else
         {
             writer.WriteEndElement();
         }
     }
     writer.WriteEndElement();
 }