コード例 #1
0
        protected Asn1Document(
            byte[] data, bool parseOctetStrings, bool showInvalidTaggedObjects, Asn1ObjectFactory objectFactory)
        {
            Data = data;
            ParseOctetStrings        = parseOctetStrings;
            ShowInvalidTaggedObjects = showInvalidTaggedObjects;

            ObjectFactory = objectFactory ?? new Asn1ObjectFactory();

            var taggedObjects = CreateTaggedObjects(data);

            if (taggedObjects != null && taggedObjects.Length > 0)
            {
                var objects = new List <Asn1Object>();
                foreach (var taggedObject in taggedObjects)
                {
                    var asn1 = ObjectFactory.CreateAsn1Object(this, taggedObject, null);
                    if (asn1 != null)
                    {
                        objects.Add(asn1);
                    }
                }

                Nodes = objects.ToArray();
            }
            else
            {
                Nodes = new Asn1Object[0];
            }
        }
コード例 #2
0
        protected Asn1Document(
            byte[] data, bool parseOctetStrings, bool showInvalidTaggedObjects, Asn1ObjectFactory objectFactory)
        {
            Data = data;
            ParseOctetStrings = parseOctetStrings;
            ShowInvalidTaggedObjects = showInvalidTaggedObjects;

            ObjectFactory = objectFactory ?? new Asn1ObjectFactory();

            var taggedObjects = CreateTaggedObjects(data);
            if (taggedObjects != null && taggedObjects.Length > 0)
            {
                var objects = new List<Asn1Object>();
                foreach (var taggedObject in taggedObjects)
                {
                    var asn1 = ObjectFactory.CreateAsn1Object(this, taggedObject, null);
                    if (asn1 != null) 
                        objects.Add(asn1);
                }

                Nodes = objects.ToArray();
            }
            else Nodes = new Asn1Object[0];
        }