export interface ISigningOptions { certificatePem?: string; privateKeyPem?: string; privateKeyPassphrase?: string; timestampServerUrl?: string; includeTimestamp?: boolean; } export interface ISignatureResult { signature: string; signatureFormat: 'CAdES-B' | 'CAdES-T' | 'CAdES-LT'; signingTime: string; certificateChain?: string[]; timestampToken?: string; timestampTime?: string; } export interface ITimestampResponse { token: string; time: string; serverUrl: string; hashAlgorithm: string; } export declare class SecurityManager { private options; private logger; constructor(options?: ISigningOptions); /** * Creates a CAdES-B (Basic) signature for data */ createCadesSignature(data: Buffer | string, certificatePem?: string, privateKeyPem?: string): Promise; /** * RFC 3161 timestamping — NOT implemented. * * The previous implementation posted a JSON blob pretending to be an ASN.1 * TimeStampReq — every real TSA rejects that, and failures were silently * swallowed (fake CAdES-T). Until a real RFC 3161 client (DER-encoded TSQ) * exists, this fails loudly; use CAdES-B (includeTimestamp: false). */ requestTimestamp(dataHash: string | Buffer): Promise; /** * Verifies a CAdES signature */ verifyCadesSignature(data: Buffer | string, signature: string, certificatePem?: string): Promise; /** * Generates a self-signed certificate for testing */ generateSelfSignedCertificate(commonName?: string, validDays?: number): Promise<{ certificate: string; privateKey: string; }>; /** * Creates a detached signature file */ createDetachedSignature(dataPath: string, outputPath: string): Promise; /** * Verifies a detached signature file */ verifyDetachedSignature(dataPath: string, signaturePath: string): Promise; /** * Adds Long-Term Validation (LTV) information */ addLtvInformation(signature: ISignatureResult, ocspResponse?: Buffer, crlData?: Buffer): Promise; }