Skip to content

Commit 2f7910e

Browse files
author
Ananth Bhaskararaman
committed
Update npm lockfile
1 parent 3622d04 commit 2f7910e

File tree

2 files changed

+618
-192
lines changed

2 files changed

+618
-192
lines changed

web/bifrost.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ export async function exportPrivateKey(privateKey, format = "pem") {
7373
export async function publicKeyFingerprint(publicKey) {
7474
const key = await crypto.subtle.exportKey("raw", publicKey);
7575
const msgBuffer = new TextEncoder().encode(key);
76-
const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);
76+
const hashBuffer = await crypto.subtle.digest("SHA-256", msgBuffer);
7777
const hashArray = Array.from(new Uint8Array(hashBuffer));
78-
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
78+
const hashHex = hashArray
79+
.map((b) => b.toString(16).padStart(2, "0"))
80+
.join("");
7981
return hashHex;
8082
}
8183

@@ -145,9 +147,16 @@ export async function bifrostId(namespace, pubKey) {
145147
*/
146148
function formatPEM(type, buffer) {
147149
return `-----BEGIN ${type}-----\n${toBase64(
148-
arrayBufferToString(buffer)).replace(/(.{64})/g, "$1\n")}\n-----END ${type}-----`;
150+
arrayBufferToString(buffer),
151+
).replace(/(.{64})/g, "$1\n")}\n-----END ${type}-----`;
149152
}
150153

154+
/**
155+
*
156+
* @param {string} signAlg
157+
* @param {string} hashAlg
158+
* @returns {pkijs.CryptoEngineAlgorithmParams}
159+
*/
151160
function getAlgorithm(signAlg, hashAlg) {
152161
const algorithm = getAlgorithmParameters(signAlg, "generatekey");
153162
if ("hash" in algorithm.algorithm) algorithm.algorithm.hash.name = hashAlg;

0 commit comments

Comments
 (0)