예제 #1
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);
        }
예제 #2
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);
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RfcAttributeTypeAndValues"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="vals">The vals.</param>
 public RfcAttributeTypeAndValues(string type, Asn1SetOf vals)
     : base(2)
 {
     Add(type);
     Add(vals);
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RfcAttributeTypeAndValues"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="vals">The vals.</param>
 public RfcAttributeTypeAndValues(RfcAttributeDescription type, Asn1SetOf vals)
     : base(2)
 {
     Add(type);
     Add(vals);
 }