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;
 }
        internal override Asn1Filter GetAsn()
        {
            var assertion = new Asn1MatchingRuleAssertion
            {
                Value = Value
            };

            if (IsDnAttribute)
            {
                assertion.DNAttributes = true;
            }
            if (Attribute != null)
            {
                assertion.Type = Attribute.GetBytes();
            }
            if (MatchingRuleId != null)
            {
                assertion.MatchingRule = MatchingRuleId.LdapString();
            }
            return(new Asn1Filter
            {
                ExtensibleMatch = assertion
            });
        }