Skip to content

Commit

Permalink
chore: move CertDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Sep 24, 2024
1 parent 823525a commit 659a638
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TlsOptions>
9 changes: 1 addition & 8 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 659a638

Please sign in to comment.