mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix function placement
This commit is contained in:
parent
a0bbe38ee7
commit
0ee5106b7a
1 changed files with 13 additions and 13 deletions
|
|
@ -8,6 +8,17 @@ const ca = loadCa();
|
||||||
|
|
||||||
const certCache = new Map();
|
const certCache = new Map();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {forge.pki.PublicKey} publicKey
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
function createKeyIdentifier(publicKey) {
|
||||||
|
return forge.pki.getPublicKeyFingerprint(publicKey, {
|
||||||
|
encoding: "binary",
|
||||||
|
md: forge.md.sha1.create(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function getCaCertPath() {
|
export function getCaCertPath() {
|
||||||
return path.join(certFolder, "ca-cert.pem");
|
return path.join(certFolder, "ca-cert.pem");
|
||||||
}
|
}
|
||||||
|
|
@ -165,6 +176,7 @@ function generateCa() {
|
||||||
digitalSignature: true,
|
digitalSignature: true,
|
||||||
keyEncipherment: true,
|
keyEncipherment: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
Subject Key Identifier (SKI)
|
Subject Key Identifier (SKI)
|
||||||
|
|
||||||
|
|
@ -174,10 +186,10 @@ function generateCa() {
|
||||||
System Python installations may be more lenient.
|
System Python installations may be more lenient.
|
||||||
https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.2
|
https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.2
|
||||||
*/
|
*/
|
||||||
{
|
|
||||||
name: "subjectKeyIdentifier",
|
name: "subjectKeyIdentifier",
|
||||||
subjectKeyIdentifier: keyIdentifier,
|
subjectKeyIdentifier: keyIdentifier,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
Authority Key Identifier (AKI)
|
Authority Key Identifier (AKI)
|
||||||
|
|
||||||
|
|
@ -187,7 +199,6 @@ function generateCa() {
|
||||||
Without this, Python virtualenv certificate validation might fail
|
Without this, Python virtualenv certificate validation might fail
|
||||||
https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.1
|
https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.1
|
||||||
*/
|
*/
|
||||||
{
|
|
||||||
name: "authorityKeyIdentifier",
|
name: "authorityKeyIdentifier",
|
||||||
keyIdentifier,
|
keyIdentifier,
|
||||||
},
|
},
|
||||||
|
|
@ -199,14 +210,3 @@ function generateCa() {
|
||||||
certificate: cert,
|
certificate: cert,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {forge.pki.PublicKey} publicKey
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
function createKeyIdentifier(publicKey) {
|
|
||||||
return forge.pki.getPublicKeyFingerprint(publicKey, {
|
|
||||||
encoding: "binary",
|
|
||||||
md: forge.md.sha1.create(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue