当前位置: 首页>>代码示例>>C#>>正文


C# XmlDictionaryWriter.StartCanonicalization方法代码示例

本文整理汇总了C#中System.Xml.XmlDictionaryWriter.StartCanonicalization方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDictionaryWriter.StartCanonicalization方法的具体用法?C# XmlDictionaryWriter.StartCanonicalization怎么用?C# XmlDictionaryWriter.StartCanonicalization使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlDictionaryWriter的用法示例。


在下文中一共展示了XmlDictionaryWriter.StartCanonicalization方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddReference

        public void AddReference(string headerId, XmlDictionaryReader reader, XmlDictionaryWriter writer)
        {
            HashStream hashStream = this.TakeHashStream();
            writer.StartCanonicalization(hashStream, false, this.InclusivePrefixes);

            // The reader must be positioned on the start element of the header / body we want to canonicalize
            writer.WriteNode(reader, false);
            writer.EndCanonicalization();
            writer.Flush();

            // Add a reference for this block
            this.AddReference(headerId, hashStream.FlushHashAndGetValue());
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:13,代码来源:SignatureProcessor.cs

示例2: WriteBodyToSignWithFragments

        public void WriteBodyToSignWithFragments(Stream stream, bool includeComments, string[] inclusivePrefixes, XmlDictionaryWriter writer)
        {
            IFragmentCapableXmlDictionaryWriter fragmentingWriter = (IFragmentCapableXmlDictionaryWriter) writer;

            SetBodyId();
            BufferedOutputStream fullBodyFragment = new BufferManagerOutputStream(SR.XmlBufferQuotaExceeded, 1024, int.MaxValue, this.securityHeader.StreamBufferManager);
            writer.StartCanonicalization(stream, includeComments, inclusivePrefixes);
            fragmentingWriter.StartFragment(fullBodyFragment, false);
            WriteStartInnerMessageWithId(writer);
            this.InnerMessage.WriteBodyContents(writer);
            writer.WriteEndElement();
            fragmentingWriter.EndFragment();
            writer.EndCanonicalization();

            this.fullBodyFragment = fullBodyFragment.ToArray(out this.fullBodyFragmentLength);

            this.state = BodyState.Signed;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:18,代码来源:SecurityAppliedMessage.cs

示例3: WriteBodyToSignThenEncryptWithFragments

        public void WriteBodyToSignThenEncryptWithFragments(
            Stream stream, bool includeComments, string[] inclusivePrefixes,
            EncryptedData encryptedData, SymmetricAlgorithm algorithm, XmlDictionaryWriter writer)
        {
            IFragmentCapableXmlDictionaryWriter fragmentingWriter = (IFragmentCapableXmlDictionaryWriter) writer;

            SetBodyId();
            encryptedData.Id = this.securityHeader.GenerateId();

            this.startBodyFragment = new MemoryStream();
            BufferedOutputStream bodyContentFragment = new BufferManagerOutputStream(SR.XmlBufferQuotaExceeded, 1024, int.MaxValue, this.securityHeader.StreamBufferManager);
            this.endBodyFragment = new MemoryStream();

            writer.StartCanonicalization(stream, includeComments, inclusivePrefixes);

            fragmentingWriter.StartFragment(this.startBodyFragment, false);
            WriteStartInnerMessageWithId(writer);
            fragmentingWriter.EndFragment();

            fragmentingWriter.StartFragment(bodyContentFragment, true);
            this.InnerMessage.WriteBodyContents(writer);
            fragmentingWriter.EndFragment();

            fragmentingWriter.StartFragment(this.endBodyFragment, false);
            writer.WriteEndElement();
            fragmentingWriter.EndFragment();

            writer.EndCanonicalization();

            int bodyLength;
            byte[] bodyBuffer = bodyContentFragment.ToArray(out bodyLength);

            encryptedData.SetUpEncryption(algorithm, new ArraySegment<byte>(bodyBuffer, 0, bodyLength));
            this.encryptedBodyContent = encryptedData;

            this.state = BodyState.SignedThenEncrypted;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:37,代码来源:SecurityAppliedMessage.cs

示例4: WriteBodyToSignWithFragments

 public void WriteBodyToSignWithFragments(Stream stream, bool includeComments, string[] inclusivePrefixes, XmlDictionaryWriter writer)
 {
     IFragmentCapableXmlDictionaryWriter writer2 = (IFragmentCapableXmlDictionaryWriter) writer;
     this.SetBodyId();
     BufferedOutputStream stream2 = new BufferManagerOutputStream("XmlBufferQuotaExceeded", 0x400, 0x7fffffff, BufferManager.CreateBufferManager(0L, 0x7fffffff));
     writer.StartCanonicalization(stream, includeComments, inclusivePrefixes);
     writer2.StartFragment(stream2, false);
     this.WriteStartInnerMessageWithId(writer);
     base.InnerMessage.WriteBodyContents(writer);
     writer.WriteEndElement();
     writer2.EndFragment();
     writer.EndCanonicalization();
     this.fullBodyFragment = stream2.ToArray(out this.fullBodyFragmentLength);
     this.state = BodyState.Signed;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:SecurityAppliedMessage.cs

示例5: WriteBodyToSignThenEncryptWithFragments

 public void WriteBodyToSignThenEncryptWithFragments(Stream stream, bool includeComments, string[] inclusivePrefixes, EncryptedData encryptedData, SymmetricAlgorithm algorithm, XmlDictionaryWriter writer)
 {
     int num;
     IFragmentCapableXmlDictionaryWriter writer2 = (IFragmentCapableXmlDictionaryWriter) writer;
     this.SetBodyId();
     encryptedData.Id = this.securityHeader.GenerateId();
     this.startBodyFragment = new MemoryStream();
     BufferedOutputStream stream2 = new BufferManagerOutputStream("XmlBufferQuotaExceeded", 0x400, 0x7fffffff, BufferManager.CreateBufferManager(0L, 0x7fffffff));
     this.endBodyFragment = new MemoryStream();
     writer.StartCanonicalization(stream, includeComments, inclusivePrefixes);
     writer2.StartFragment(this.startBodyFragment, false);
     this.WriteStartInnerMessageWithId(writer);
     writer2.EndFragment();
     writer2.StartFragment(stream2, true);
     base.InnerMessage.WriteBodyContents(writer);
     writer2.EndFragment();
     writer2.StartFragment(this.endBodyFragment, false);
     writer.WriteEndElement();
     writer2.EndFragment();
     writer.EndCanonicalization();
     byte[] array = stream2.ToArray(out num);
     encryptedData.SetUpEncryption(algorithm, new ArraySegment<byte>(array, 0, num));
     this.encryptedBodyContent = encryptedData;
     this.state = BodyState.SignedThenEncrypted;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:SecurityAppliedMessage.cs

示例6: WriteCanonicalizedBodyWithFragments

        void WriteCanonicalizedBodyWithFragments(Stream canonicalStream, XmlDictionaryWriter writer)
        {
            byte[] buffer = null;
            if (this.discoveryInfo.SupportsInclusivePrefixes)
            {
                buffer = this.BufferBodyAndGetInclusivePrefixes();
            }

            using (MemoryStream bodyBufferStream = new MemoryStream())
            {
                writer.StartCanonicalization(canonicalStream, false, this.inclusivePrefixes);
                IFragmentCapableXmlDictionaryWriter fragmentingWriter = (IFragmentCapableXmlDictionaryWriter)writer;
                fragmentingWriter.StartFragment(bodyBufferStream, false);
                this.WriteBufferOrMessageBody(writer, buffer);
                fragmentingWriter.EndFragment();
                writer.EndCanonicalization();
                writer.Flush();

                this.fullBodyFragmentLength = (int)bodyBufferStream.Length;
                this.fullBodyFragment = bodyBufferStream.ToArray();
            }
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:22,代码来源:SignedMessage.cs


注:本文中的System.Xml.XmlDictionaryWriter.StartCanonicalization方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。