/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Bytes, Construction, Duration, Environment } from "@matter/general";
import { DclClient } from "./DclClient.js";
import { DclConfig, DclGithubConfig } from "./DclConfig.js";
/**
 * Implements a service to manage DCL root certificates as a singleton in the environment and so will be shared by
 * multiple nodes of relevant. It is mainly relevant for controller use cases.
 * The service supports fetching certificates from teh CSA production and test DCL instances, as well
 * as from a GitHub repository for development certificates.
 */
export declare class DclCertificateService {
    #private;
    constructor(environment: Environment, options?: DclCertificateService.Options);
    get construction(): Construction<DclCertificateService>;
    /**
     * Get certificate metadata by subject key identifier. Returns undefined if not found.
     */
    getCertificate(subjectKeyId: Bytes | string): DclCertificateService.CertificateMetadata | undefined;
    /**
     * Get all certificate metadata entries.
     */
    get certificates(): DclCertificateService.CertificateMetadata[];
    /**
     * Get certificate as PEM string.
     * @throws {MatterDclError} if certificate not found
     */
    getCertificateAsPem(subjectKeyId: Bytes | string): Promise<string>;
    /**
     * Get certificate metadata by subject key identifier, fetching from DCL if not in local storage. Returns
     * undefined if not found.
     */
    getOrFetchCertificate(subjectKeyId: Bytes | string, options?: DclClient.Options & {
        isProduction?: boolean;
    }): Promise<DclCertificateService.CertificateMetadata | undefined>;
    /**
     * Delete a certificate from storage and index.
     */
    deleteCertificate(subjectKeyId: Bytes | string): Promise<void>;
    /**
     * Close the service and stop all timers.
     */
    close(): Promise<void>;
    /**
     * Update certificates from DCL and GitHub. Returns true if update succeeded, false if it failed.
     */
    update(force?: boolean): Promise<boolean | void>;
}
export declare namespace DclCertificateService {
    interface Options {
        /** Whether to fetch test certificates in addition to production ones. Default is false. */
        fetchTestCertificates?: boolean;
        /** Whether to fetch development certificates from GitHub. Default is true (when fetchTestCertificates is true). */
        fetchGithubCertificates?: boolean;
        /**
         * Interval for periodic certificate updates. Default is 1 day. Set to null to disable automatic certificate
         * updates
         */
        updateInterval?: Duration | null;
        /** Timeout for DCL requests. Default is 5s. */
        timeout?: Duration;
        /** DCL config for production endpoint. Defaults to DclConfig.production. */
        dclConfig?: DclConfig;
        /** DCL config for test endpoint. Defaults to DclConfig.test. */
        testDclConfig?: DclConfig;
        /** GitHub config for development certificates. Programmatic override only. Defaults to DclGithubConfig.defaults. */
        githubConfig?: DclGithubConfig;
    }
    /**
     * Metadata for a stored certificate.
     */
    type CertificateMetadata = {
        subject?: string;
        subjectAsText?: string;
        subjectKeyId: string;
        serialNumber: string;
        vid: number;
        isRoot: boolean;
        isProduction: boolean;
    };
}
//# sourceMappingURL=DclCertificateService.d.ts.map