start the path to rust

This commit is contained in:
2026-02-10 15:54:09 +00:00
parent 237dba3bab
commit 8bd8c295b0
318 changed files with 28352 additions and 428 deletions

View File

@@ -0,0 +1,68 @@
import * as plugins from '../../plugins.js';
import { Email } from '../core/classes.email.js';
export interface IKeyPaths {
privateKeyPath: string;
publicKeyPath: string;
}
export interface IDkimKeyMetadata {
domain: string;
selector: string;
createdAt: number;
rotatedAt?: number;
previousSelector?: string;
keySize: number;
}
export declare class DKIMCreator {
private keysDir;
private storageManager?;
constructor(keysDir?: string, storageManager?: any);
getKeyPathsForDomain(domainArg: string): Promise<IKeyPaths>;
handleDKIMKeysForDomain(domainArg: string): Promise<void>;
handleDKIMKeysForEmail(email: Email): Promise<void>;
readDKIMKeys(domainArg: string): Promise<{
privateKey: string;
publicKey: string;
}>;
createDKIMKeys(): Promise<{
privateKey: string;
publicKey: string;
}>;
storeDKIMKeys(privateKey: string, publicKey: string, privateKeyPath: string, publicKeyPath: string): Promise<void>;
createAndStoreDKIMKeys(domain: string): Promise<void>;
getDNSRecordForDomain(domainArg: string): Promise<plugins.tsclass.network.IDnsRecord>;
/**
* Get DKIM key metadata for a domain
*/
private getKeyMetadata;
/**
* Save DKIM key metadata
*/
private saveKeyMetadata;
/**
* Check if DKIM keys need rotation
*/
needsRotation(domain: string, selector?: string, rotationIntervalDays?: number): Promise<boolean>;
/**
* Rotate DKIM keys for a domain
*/
rotateDkimKeys(domain: string, currentSelector?: string, keySize?: number): Promise<string>;
/**
* Get key paths for a specific selector
*/
getKeyPathsForSelector(domain: string, selector: string): Promise<IKeyPaths>;
/**
* Read DKIM keys for a specific selector
*/
readDKIMKeysForSelector(domain: string, selector: string): Promise<{
privateKey: string;
publicKey: string;
}>;
/**
* Get DNS record for a specific selector
*/
getDNSRecordForSelector(domain: string, selector: string): Promise<plugins.tsclass.network.IDnsRecord>;
/**
* Clean up old DKIM keys after grace period
*/
cleanupOldKeys(domain: string, gracePeriodDays?: number): Promise<void>;
}