/** Thrown before upload when the certificate chain isn't a readable PEM certificate. */ export declare class CertificateParseError extends Error { readonly id = "invalid_certificate"; readonly statusCode = 422; constructor(cause: unknown); get body(): { id: string; message: string; }; } /** * Thrown before upload when a hostname passed to `createAndAssociate`'s `domains` * option isn't one of the app's domains, or isn't covered by the certificate. */ export declare class CertificateDomainsMismatchError extends Error { readonly appIdentity: string; readonly notOnApp: string[]; readonly notCovered: string[]; readonly id = "domains_mismatch"; readonly statusCode = 422; constructor(appIdentity: string, notOnApp: string[], notCovered: string[]); get body(): { id: string; message: string; not_covered: string[]; not_on_app: string[]; }; } /** * Thrown before upload when `createAndAssociate` gets neither `domains` nor * `chooseDomains` and the certificate covers some of the app's domains, so the caller * has to choose which to associate. `matches` lists them. */ export declare class CertificateDomainsRequiredError extends Error { readonly appIdentity: string; readonly matches: string[]; readonly id = "domains_required"; readonly statusCode = 422; constructor(appIdentity: string, matches: string[]); get body(): { id: string; matches: string[]; message: string; }; } /** * The DNS names a certificate covers, read locally from the first (leaf) certificate * in a PEM chain: its subjectAltName DNS entries, or its subject CN when it has none. * Lowercased. `createAndAssociate` matches app domains against these, before and after * upload; once uploaded, the API's `ssl_cert.cert_domains` is authoritative. * * Parsed with `asn1js`, which runs in Node and in browsers. It's loaded on first call, * so importing the SDK doesn't load it. * * @throws `CertificateParseError` if the chain isn't a parseable PEM certificate. */ export declare function certificateNames(certificateChain: string): Promise; /** * Whether a certificate name covers a hostname, case-insensitively. An exact name * matches only itself; a wildcard (`*.example.com`) matches exactly one extra label * (`www.example.com`), not the apex or deeper names (`a.b.example.com`), and not names * that only contain it (`www.example.com.evil.org`). Plain string comparison: a * certificate's names are never interpreted as patterns. */ export declare function certificateNameCovers(certificateName: string, hostname: string): boolean; /** The hostnames covered by any of the certificate's names, in `hostnames` order. */ export declare function matchDomains(certificateNames: string[], hostnames: string[]): string[];