mirror of
https://github.com/certd/certd.git
synced 2026-04-14 20:40:53 +08:00
perf: dcdn自动匹配部署,支持新增域名感知
This commit is contained in:
@@ -43,6 +43,12 @@ const formats = {
|
||||
jks: ["jks"],
|
||||
p7b: ["p7b", "key"],
|
||||
};
|
||||
|
||||
export type SimpleCertDetail = {
|
||||
notBefore: Date;
|
||||
notAfter: Date;
|
||||
domains: string[];
|
||||
};
|
||||
export class CertReader {
|
||||
cert: CertInfo;
|
||||
|
||||
@@ -116,6 +122,15 @@ export class CertReader {
|
||||
return CertReader.readCertDetail(crt);
|
||||
}
|
||||
|
||||
getSimpleDetail() {
|
||||
const { detail } = this.getCrtDetail();
|
||||
return {
|
||||
notBefore: detail.notBefore,
|
||||
notAfter: detail.notAfter,
|
||||
domains: this.getAllDomains(),
|
||||
};
|
||||
}
|
||||
|
||||
static readCertDetail(crt: string) {
|
||||
const detail = crypto.readCertificateInfo(crt.toString());
|
||||
const effective = detail.notBefore;
|
||||
|
||||
Reference in New Issue
Block a user