public LdapAttribute(LdapAttributeDescription type, ReadOnlyMemory <byte>[] values) { if (values is null) { throw new ArgumentNullException(nameof(values)); } Type = type; Values = values; }
internal LdapSubstringFilter(ReadOnlySpan <char> description, ReadOnlyMemory <byte>?initial, ReadOnlyMemory <byte>[] any, ReadOnlyMemory <byte>?final) { if (!initial.HasValue && !final.HasValue && any.Length == 0) { throw new ArgumentException("at least one part must be set"); } Attribute = new LdapAttributeDescription(description); StartsWith = initial; Contains = any; EndsWith = final; }
internal LdapExtensibleMatchFilter(ReadOnlySpan <char> description, bool isDn, ReadOnlySpan <char> matchingRule, ReadOnlySpan <char> assertion) { if (!description.IsEmpty) { Attribute = new LdapAttributeDescription(description); } IsDnAttribute = isDn; if (!matchingRule.IsEmpty) { MatchingRuleId = matchingRule.Oid(); } Value = assertion.LdapString(); }
internal LdapExtensibleMatchFilter(Asn1MatchingRuleAssertion assertion) { if (assertion.Type.HasValue) { Attribute = new LdapAttributeDescription(assertion.Type.Value.Span); } IsDnAttribute = assertion.DNAttributes.GetValueOrDefault(); if (assertion.MatchingRule.HasValue) { //RFC 4511 4.1.8 && RFC 4520 3.4 MatchingRuleId = assertion.MatchingRule.Value.Span.Oid(); } Value = assertion.Value; }
public LdapAttributeSelection(ReadOnlySpan <char> data) { if (data.Length == 1 && data[0] == '*') { AllUserAttributes = true; } else if (data.Length == 3 && data == "1.1") { NoAttributes = true; } else { Selector = new LdapAttributeDescription(data); } }
internal LdapSubstringFilter(Asn1SubstringFilter filter) { Attribute = new LdapAttributeDescription(filter.Type.Span); var contains = new List <ReadOnlyMemory <byte> >(); foreach (var substring in filter.Substrings) { if (substring.Initial.HasValue) { StartsWith = substring.Initial.Value; } else if (substring.Final.HasValue) { EndsWith = substring.Final.Value; } else if (substring.Any.HasValue) { contains.Add(substring.Any.Value); } } Contains = contains; }
internal LdapAttributeAssertion(ReadOnlySpan <char> description, ReadOnlyMemory <byte> value) { Attribute = new LdapAttributeDescription(description); Value = value; }
internal LdapAttributeAssertion(Asn1AttributeValueAssertion assertion) { Attribute = new LdapAttributeDescription(assertion.Description.Span); Value = assertion.Value; }
internal LdapAttribute(Asn1PartialAttribute attribute) { Type = new LdapAttributeDescription(attribute.Type.Span); Values = attribute.Values; }
internal LdapPresentFilter(ReadOnlySpan <char> attribute) { Attribute = new LdapAttributeDescription(attribute); }
internal LdapPresentFilter(ReadOnlyMemory <byte> attribute) { Attribute = new LdapAttributeDescription(attribute.Span); }