mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
More cleanup
This commit is contained in:
parent
940603ae73
commit
d018246292
1 changed files with 2 additions and 4 deletions
|
|
@ -99,7 +99,7 @@ export function generateCertForHost(hostname) {
|
|||
keyIdentifier: authorityKeyIdentifier,
|
||||
},
|
||||
]);
|
||||
cert.sign(/** @type {any} */ (ca.privateKey), forge.md.sha256.create());
|
||||
cert.sign(ca.privateKey, forge.md.sha256.create());
|
||||
|
||||
const result = {
|
||||
privateKey: forge.pki.privateKeyToPem(keys.privateKey),
|
||||
|
|
@ -132,13 +132,11 @@ function loadCa() {
|
|||
fs.mkdirSync(certFolder, { recursive: true });
|
||||
fs.writeFileSync(keyPath, forge.pki.privateKeyToPem(privateKey));
|
||||
fs.writeFileSync(certPath, forge.pki.certificateToPem(certificate));
|
||||
|
||||
return { privateKey, certificate };
|
||||
}
|
||||
|
||||
function generateCa() {
|
||||
const keys = forge.pki.rsa.generateKeyPair(2048);
|
||||
|
||||
const cert = forge.pki.createCertificate();
|
||||
cert.publicKey = keys.publicKey;
|
||||
cert.serialNumber = "01";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue