import { Logger } from '@n8n/backend-common';
import { DbLockService } from '@n8n/db';
import { InstanceSettings } from 'n8n-core';
import { TrustedKeySourceEntity } from '../database/entities/trusted-key-source.entity';
import { TrustedKeyEntity } from '../database/entities/trusted-key.entity';
import { TrustedKeySourceRepository } from '../database/repositories/trusted-key-source.repository';
import { TrustedKeyRepository } from '../database/repositories/trusted-key.repository';
import { TokenExchangeConfig } from '../token-exchange.config';
import type { ResolvedTrustedKey } from '../token-exchange.schemas';
import { JwksResolverService } from './jwks-resolver';
export declare class TrustedKeyService {
    private readonly config;
    private readonly trustedKeySourceRepository;
    private readonly trustedKeyRepository;
    private readonly instanceSettings;
    private readonly dbLockService;
    private readonly jwksResolverService;
    private readonly logger;
    private refreshInterval;
    private isShuttingDown;
    private readonly cryptoCache;
    constructor(logger: Logger, config: TokenExchangeConfig, trustedKeySourceRepository: TrustedKeySourceRepository, trustedKeyRepository: TrustedKeyRepository, instanceSettings: InstanceSettings, dbLockService: DbLockService, jwksResolverService: JwksResolverService);
    initialize(): Promise<void>;
    onLeaderTakeover(): Promise<void>;
    private initializeAsLeader;
    startRefresh(): void;
    stopRefresh(): void;
    shutdown(): void;
    getByKidAndIss(kid: string, issuer: string): Promise<ResolvedTrustedKey | undefined>;
    refreshSource(sourceId: string): Promise<void>;
    listAll(): Promise<TrustedKeyEntity[]>;
    listSources(): Promise<TrustedKeySourceEntity[]>;
    private parseConfigSources;
    private generateSourceId;
    private syncSourcesToDb;
    private refreshAllSources;
    private refreshDueSources;
    private getRefreshIntervalMs;
    private refreshSourceInternal;
    private refreshSourceWithinTransaction;
    private resolveKeysForSource;
    private resolveKeysForJwksSource;
    private resolveKeysForStaticSource;
    private resolveStaticKeys;
    private validateKeyMaterial;
    private resolveCryptoKey;
}
