LdifDotNet.Schema 0.8.0

dotnet add package LdifDotNet.Schema --version 0.8.0
                    
NuGet\Install-Package LdifDotNet.Schema -Version 0.8.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LdifDotNet.Schema" Version="0.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LdifDotNet.Schema" Version="0.8.0" />
                    
Directory.Packages.props
<PackageReference Include="LdifDotNet.Schema" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LdifDotNet.Schema --version 0.8.0
                    
#r "nuget: LdifDotNet.Schema, 0.8.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LdifDotNet.Schema@0.8.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LdifDotNet.Schema&version=0.8.0
                    
Install as a Cake Addin
#tool nuget:?package=LdifDotNet.Schema&version=0.8.0
                    
Install as a Cake Tool

LdifDotNet.Schema

Parser for LDAP schema definitions: RFC 4512 attributetype / objectclass descriptions in slapd.conf schema-file format, including objectidentifier OID macros — and the bare definition values a live server publishes in its subschema subentry. Dependency-free.

using LdifDotNet.Schema;

var schema = LdapSchema.Load("core.schema", "cosine.schema", "inetorgperson.schema");

var person = schema.FindObjectClass("inetOrgPerson");
var required = schema.RequiredAttributeNames(person);   // MUST, inherited through SUP chain
var optional = schema.OptionalAttributeNames(person);   // MAY, inherited through SUP chain

var sn = schema.FindAttributeType("surname");            // lookup by any name or OID
Console.WriteLine(sn.Syntax);                            // 1.3.6.1.4.1.1466.115.121.1.15

Schema read from a live server's cn=Subschema entry parses leniently — the consumer cannot fix a server's schema, so a definition that fails to parse is preserved raw in UnparsedDefinitions instead of failing the whole schema:

// attributeTypes / objectClasses / ldapSyntaxes values from the subschema subentry
var schema = LdapSchema.ParseSubschema(attributeTypeValues, objectClassValues, ldapSyntaxValues);
foreach (var bad in schema.UnparsedDefinitions)
    Console.WriteLine($"unparsed {bad.Kind}: {bad.Error}");

// A live server publishes cn as "SUP name" with no SYNTAX; resolution walks the chain:
var cn = schema.FindAttributeType("cn");
string? syntaxOid = schema.ResolveSyntaxOid(cn);        // 1.3.6.1.4.1.1466.115.121.1.15
var syntax = schema.FindSyntax(syntaxOid);              // bounds like {32768} strip automatically
bool octets = syntax.NotHumanReadable;                  // OpenLDAP's X-NOT-HUMAN-READABLE 'TRUE'

// Strict single-definition parsing is also available:
var sn = LdapAttributeType.Parse("( 2.5.4.4 NAME ( 'sn' 'surname' ) SUP name )");

Proven against OpenLDAP's complete shipped schema set plus eduPerson, rfc2307bis, sudo, and openssh-lpk — and, for subschema input, against the cn=Subschema entry a real OpenLDAP 2.6 server publishes.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LdifDotNet.Schema:

Package Downloads
LdifDotNet.Generator

Fake LDAP directory data generator for LdifDotNet, powered by Bogus.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 570 8/8/2026
0.7.0 130 8/7/2026
0.6.0 175 8/3/2026
0.5.0 119 7/29/2026
0.3.0 115 7/17/2026
0.2.0 125 7/17/2026
0.1.0 120 7/17/2026