コード例 #1
0
ファイル: LdapModifyrequest.cs プロジェクト: rflechner/swan
        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
ファイル: LdapModifyrequest.cs プロジェクト: rflechner/swan
 /// <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);
 }