mirror of https://github.com/certd/certd
chore:
parent
21f50e0b38
commit
0e7578043e
|
@ -32,6 +32,7 @@ export type CertInfo = {
|
||||||
pfx?: string;
|
pfx?: string;
|
||||||
der?: string;
|
der?: string;
|
||||||
jks?: string;
|
jks?: string;
|
||||||
|
one?: string;
|
||||||
};
|
};
|
||||||
export type SSLProvider = "letsencrypt" | "google" | "zerossl";
|
export type SSLProvider = "letsencrypt" | "google" | "zerossl";
|
||||||
export type PrivateKeyType = "rsa_1024" | "rsa_2048" | "rsa_3072" | "rsa_4096" | "ec_256" | "ec_384" | "ec_521";
|
export type PrivateKeyType = "rsa_1024" | "rsa_2048" | "rsa_3072" | "rsa_4096" | "ec_256" | "ec_384" | "ec_521";
|
||||||
|
|
|
@ -192,6 +192,7 @@ export abstract class CertApplyBasePlugin extends AbstractTaskPlugin {
|
||||||
zip.file("cert.key", cert.key);
|
zip.file("cert.key", cert.key);
|
||||||
zip.file("intermediate.crt", cert.ic);
|
zip.file("intermediate.crt", cert.ic);
|
||||||
zip.file("origin.crt", cert.oc);
|
zip.file("origin.crt", cert.oc);
|
||||||
|
zip.file("one.pem", cert.one);
|
||||||
if (cert.pfx) {
|
if (cert.pfx) {
|
||||||
zip.file("cert.pfx", Buffer.from(cert.pfx, "base64"));
|
zip.file("cert.pfx", Buffer.from(cert.pfx, "base64"));
|
||||||
}
|
}
|
||||||
|
@ -209,6 +210,7 @@ cert.crt:证书文件,包含证书链,pem格式
|
||||||
cert.key:私钥文件,pem格式
|
cert.key:私钥文件,pem格式
|
||||||
intermediate.crt:中间证书文件,pem格式
|
intermediate.crt:中间证书文件,pem格式
|
||||||
origin.crt:原始证书文件,不含证书链,pem格式
|
origin.crt:原始证书文件,不含证书链,pem格式
|
||||||
|
one.pem: 证书和私钥简单合并成一个文件,pem格式,crt正文+key正文
|
||||||
cert.pfx:pfx格式证书文件,iis服务器使用
|
cert.pfx:pfx格式证书文件,iis服务器使用
|
||||||
cert.der:der格式证书文件
|
cert.der:der格式证书文件
|
||||||
cert.jks:jks格式证书文件,java服务器使用
|
cert.jks:jks格式证书文件,java服务器使用
|
||||||
|
|
|
@ -25,6 +25,7 @@ export class CertReader {
|
||||||
key: string;
|
key: string;
|
||||||
csr: string;
|
csr: string;
|
||||||
ic: string; //中间证书
|
ic: string; //中间证书
|
||||||
|
one: string; //crt + key 合成一个pem文件
|
||||||
|
|
||||||
detail: any;
|
detail: any;
|
||||||
expires: number;
|
expires: number;
|
||||||
|
@ -46,6 +47,12 @@ export class CertReader {
|
||||||
this.cert.oc = this.oc;
|
this.cert.oc = this.oc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.one = certInfo.one;
|
||||||
|
if (!this.one) {
|
||||||
|
this.one = this.crt + "\n" + this.key;
|
||||||
|
this.cert.one = this.one;
|
||||||
|
}
|
||||||
|
|
||||||
const { detail, expires } = this.getCrtDetail(this.cert.crt);
|
const { detail, expires } = this.getCrtDetail(this.cert.crt);
|
||||||
this.detail = detail;
|
this.detail = detail;
|
||||||
this.expires = expires.getTime();
|
this.expires = expires.getTime();
|
||||||
|
|
Loading…
Reference in New Issue