Ejemplo n.º 1
0
        private Asn1SetOf ParseFilterList()
        {
            var setOf = new Asn1SetOf();

            setOf.Add(ParseFilter()); // must have at least 1 filter
            while (_ft.PeekChar() == '(')
            {
                // check for more filters
                setOf.Add(ParseFilter());
            }

            return(setOf);
        }
Ejemplo n.º 2
0
        private static Asn1SequenceOf EncodeModifications(LdapModification[] mods)
        {
            var rfcMods = new Asn1SequenceOf(mods.Length);

            foreach (var t in mods)
            {
                var attr = t.Attribute;

                var vals = new Asn1SetOf(attr.Size());
                if (attr.Size() > 0)
                {
                    foreach (var val in attr.ByteValueArray)
                    {
                        vals.Add(new Asn1OctetString(val));
                    }
                }

                var rfcMod = new Asn1Sequence(2);
                rfcMod.Add(new Asn1Enumerated((int)t.Op));
                rfcMod.Add(new RfcAttributeTypeAndValues(attr.Name, vals));

                rfcMods.Add(rfcMod);
            }

            return(rfcMods);
        }