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];
            }
        }
 public Asn1Object CreateAsn1Object(Asn1Document document, TaggedObject content, Asn1Object parent)
 {
     return(ObjectFactory.CreateAsn1Object(document, content, parent));
 }