コード例 #1
0
        protected static long ResetBranchDataLength(Asn1Node node)
        {
            long num = 0;

            if (node.ChildNodeCount < 1L)
            {
                if (node.data != null)
                {
                    num += (long)node.data.Length;
                }
            }
            else
            {
                for (int index = 0; (long)index < node.ChildNodeCount; ++index)
                {
                    num += Asn1Node.ResetBranchDataLength(node.GetChildNode(index));
                }
            }
            node.dataLength = num;
            if (node.tag == (byte)3)
            {
                ++node.dataLength;
            }
            Asn1Node.ResetDataLengthFieldWidth(node);
            return(node.dataLength + 1L + node.lengthFieldBytes);
        }
コード例 #2
0
        protected void RecalculateTreePar()
        {
            if (!this.requireRecalculatePar)
            {
                return;
            }
            Asn1Node asn1Node = this;

            while (asn1Node.ParentNode != null)
            {
                asn1Node = asn1Node.ParentNode;
            }
            Asn1Node.ResetBranchDataLength(asn1Node);
            asn1Node.dataOffset = 0L;
            asn1Node.deepness   = 0L;
            long subOffset = asn1Node.dataOffset + 1L + asn1Node.lengthFieldBytes;

            this.ResetChildNodePar(asn1Node, subOffset);
        }