diff --git a/src/types.ts b/src/types.ts index e49b86b..cf6fec6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -29,4 +29,12 @@ export interface GenerateCertOptions { commonName?: string } +export type CertDetails = { + subject: any + issuer: any + validFrom: Date + validTo: Date + serialNumber: string +} + export type TlsConfig = DeepPartial diff --git a/src/utils.ts b/src/utils.ts index 0492ada..c0faed7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,6 +2,7 @@ import fs from 'node:fs' import os from 'node:os' import path from 'node:path' import { pki } from 'node-forge' +import type { CertDetails } from './types' /** * Checks if a certificate is valid for a given domain. @@ -33,14 +34,6 @@ export function readCertFromFile(certPath: string): string { return fs.readFileSync(certPath, 'utf8') } -export type CertDetails = { - subject: any - issuer: any - validFrom: Date - validTo: Date - serialNumber: string -} - /** * Parses and extracts details from a certificate. * @param certPemOrPath - The certificate in PEM format or the path to the certificate file.