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); }
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); }
/// <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); }
/// <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); }