36 lines
1022 B
TypeScript
36 lines
1022 B
TypeScript
import type { SmartacmeCert } from '../smartacme.classes.cert.js';
|
|
|
|
// (ICertRecord removed; use SmartacmeCert directly)
|
|
|
|
/**
|
|
* Interface for certificate storage managers.
|
|
* Users can implement this to provide custom persistence (in-memory,
|
|
* file-based, Redis, etc.).
|
|
*/
|
|
export interface ICertManager {
|
|
/**
|
|
* Initialize the store (e.g., connect to database).
|
|
*/
|
|
init(): Promise<void>;
|
|
/**
|
|
* Retrieve a certificate record by domain name.
|
|
* Returns null if none found.
|
|
*/
|
|
retrieveCertificate(domainName: string): Promise<SmartacmeCert | null>;
|
|
/**
|
|
* Store a certificate record. Fulfills any pending interests.
|
|
*/
|
|
storeCertificate(cert: SmartacmeCert): Promise<void>;
|
|
/**
|
|
* Delete a certificate record by domain name.
|
|
*/
|
|
deleteCertificate(domainName: string): Promise<void>;
|
|
/**
|
|
* Close the store (e.g., disconnect database).
|
|
*/
|
|
close(): Promise<void>;
|
|
/**
|
|
* Optional: wipe all stored certificates (e.g., for integration testing)
|
|
*/
|
|
wipe(): Promise<void>;
|
|
} |