import { OBJECT_IDENTIFIER } from "@wildboar/asn1"; import { ObjectClassKind } from "../modules/InformationFramework/ObjectClassKind.ta.mjs"; /** * @summary Validate a set of object classes * @description * * There are restrictions on which object classes may be used together. This * function validates a set of object classes for compliance to these * restrictions, which are specified in ITU-T Recommendation X.501 (2019), * Sections 8.3 and 13.3.1. * * Quoting section 13.3.1: * * > There are restrictions on subclassing, namely: * > * > - only abstract object classes shall be superclasses of other abstract object classes. * > - a structural object class shall not be derived from auxiliary object classes. * > - an auxiliary object class shall not be derived from structural object classes. * > * > There is one special object class, of which every structural object class * > is a subclass. This object class is called top. top is an abstract object * > class. * * I don't think an implementation of this can be done without allocation and * without introducing O(n^2) time complexity, since each object class must be * compared against other object classes in the set. You need at least one `Set`. * * @param {OBJECT_IDENTIFIER[]} objectClasses The object classes to be validated * @param {Function} getKind A function that returns the object class' kind given its OID * @param {Function} getSuperclasses A function that returns the object class' superclasses * given its OID * @returns {ObjectIdentifier} The structural object class if the object classes * are valid, or `null` otherwise. * @function */ export declare function validateObjectClasses(objectClasses: OBJECT_IDENTIFIER[], getKind: (objectClass: OBJECT_IDENTIFIER) => ObjectClassKind | undefined | null, getSuperclasses: (objectClass: OBJECT_IDENTIFIER) => OBJECT_IDENTIFIER[]): OBJECT_IDENTIFIER | null; export default validateObjectClasses; //# sourceMappingURL=validateObjectClasses.d.mts.map