import type EqualityMatcher from "../types/EqualityMatcher.mjs"; import type { OBJECT_IDENTIFIER, External } from "@wildboar/asn1"; import { ASN1Element } from "@wildboar/asn1"; import type { GeneralName } from "../modules/CertificateExtensions/GeneralName.ta.mjs"; import type { GeneralSubtree } from "../modules/CertificateExtensions/GeneralSubtree.ta.mjs"; /** * @summary Determine whether an SRVName matches a base SRVName. * @description * * This is used to evaluate SRVName name constraints, per the procedures * described in * [IETF RFC 4985](https://datatracker.ietf.org/doc/html/rfc4985.html#section-4). * * This name form isn't truly hierarchical, but since it has well-defined * procedures for evaluating name constraints, it is supported. * * @param {string} base The base SRVName. * @param {string} name The name to be evaluated. * @returns {boolean} `true` if the name matches the base. */ export declare function evaluateSRVNameConstraints(base: string, name: string): boolean; /** @internal */ export declare function countDNSLabels(s: string): number; /** @internal */ export declare function externalEncodingToElement(enc: External["encoding"]): ASN1Element | null; /** * @summary Determine whether an X.509v3 general name falls within a subtree. * @description * * If the `GeneralName` `gn` and the `base` of the `GeneralSubtree` `subtree` * differ by variant, this returns `false`. * * If the `GeneralName` variant used does not have a well-defined hierarchical * structure to it, this returns `false`. The variants that _do_ have a * well-defined hierarchical structure are: * * - `dNSName` * - `directoryName` * - `registeredID` * - `otherName`, if the `SRVName` `OTHER-NAME` type is used * * All of the registered IANA `OTHER-NAME` forms have been evaluated for * suitability, but only the `SRVName` form has clearly-defined * name constraints evaluation procedures. Oddly, the `SRVName` form does * not seem to use the `minimum` and `maximum` bounds; if the `minimum` is * set in this case, this implementation will always return `false`. * * ### Relevant ASN.1 Definitions * * ```asn1 * GeneralSubtree ::= SEQUENCE { * base GeneralName, * minimum [0] BaseDistance DEFAULT 0, * maximum [1] BaseDistance OPTIONAL, * ... } * * BaseDistance ::= INTEGER(0..MAX) * * GeneralName ::= CHOICE { * otherName [0] INSTANCE OF OTHER-NAME, * rfc822Name [1] IA5String, * dNSName [2] IA5String, * x400Address [3] ORAddress, * directoryName [4] Name, * ediPartyName [5] EDIPartyName, * uniformResourceIdentifier [6] IA5String, * iPAddress [7] OCTET STRING, * registeredID [8] OBJECT IDENTIFIER, * ... } * ``` * * @returns {Boolean} `true` if the general name falls within the subtree * @function */ export declare function gnWithinGeneralSubtree(gn: GeneralName, subtree: GeneralSubtree, getEqualityMatcher?: (attributeType: OBJECT_IDENTIFIER) => EqualityMatcher | undefined): boolean; export default gnWithinGeneralSubtree; //# sourceMappingURL=gnWithinGeneralSubtree.d.mts.map