1 |
|
2 | export interface CaCertificateUpdate {
|
3 | caCertificate: Buffer;
|
4 | }
|
5 | export interface IdentityCertificateUpdate {
|
6 | certificate: Buffer;
|
7 | privateKey: Buffer;
|
8 | }
|
9 | export interface CaCertificateUpdateListener {
|
10 | (update: CaCertificateUpdate | null): void;
|
11 | }
|
12 | export interface IdentityCertificateUpdateListener {
|
13 | (update: IdentityCertificateUpdate | null): void;
|
14 | }
|
15 | export interface CertificateProvider {
|
16 | addCaCertificateListener(listener: CaCertificateUpdateListener): void;
|
17 | removeCaCertificateListener(listener: CaCertificateUpdateListener): void;
|
18 | addIdentityCertificateListener(listener: IdentityCertificateUpdateListener): void;
|
19 | removeIdentityCertificateListener(listener: IdentityCertificateUpdateListener): void;
|
20 | }
|
21 | export interface FileWatcherCertificateProviderConfig {
|
22 | certificateFile?: string | undefined;
|
23 | privateKeyFile?: string | undefined;
|
24 | caCertificateFile?: string | undefined;
|
25 | refreshIntervalMs: number;
|
26 | }
|
27 | export declare class FileWatcherCertificateProvider implements CertificateProvider {
|
28 | private config;
|
29 | private refreshTimer;
|
30 | private fileResultPromise;
|
31 | private latestCaUpdate;
|
32 | private caListeners;
|
33 | private latestIdentityUpdate;
|
34 | private identityListeners;
|
35 | private lastUpdateTime;
|
36 | constructor(config: FileWatcherCertificateProviderConfig);
|
37 | private updateCertificates;
|
38 | private maybeStartWatchingFiles;
|
39 | private maybeStopWatchingFiles;
|
40 | addCaCertificateListener(listener: CaCertificateUpdateListener): void;
|
41 | removeCaCertificateListener(listener: CaCertificateUpdateListener): void;
|
42 | addIdentityCertificateListener(listener: IdentityCertificateUpdateListener): void;
|
43 | removeIdentityCertificateListener(listener: IdentityCertificateUpdateListener): void;
|
44 | }
|