mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
암호 키 생성 및 등록시 HSK도 함께 생성 및 등록하도록 변경
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ClientInit } from "@sveltejs/kit";
|
||||
import { getClientKey, getMasterKeys } from "$lib/indexedDB";
|
||||
import { clientKeyStore, masterKeyStore } from "$lib/stores";
|
||||
import { getClientKey, getMasterKeys, getHmacSecrets } from "$lib/indexedDB";
|
||||
import { clientKeyStore, masterKeyStore, hmacSecretStore } from "$lib/stores";
|
||||
|
||||
const prepareClientKeyStore = async () => {
|
||||
const [encryptKey, decryptKey, signKey, verifyKey] = await Promise.all([
|
||||
@@ -21,6 +21,13 @@ const prepareMasterKeyStore = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
export const init: ClientInit = async () => {
|
||||
await Promise.all([prepareClientKeyStore(), prepareMasterKeyStore()]);
|
||||
const prepareHmacSecretStore = async () => {
|
||||
const hmacSecrets = await getHmacSecrets();
|
||||
if (hmacSecrets.length > 0) {
|
||||
hmacSecretStore.set(new Map(hmacSecrets.map((hmacSecret) => [hmacSecret.version, hmacSecret])));
|
||||
}
|
||||
};
|
||||
|
||||
export const init: ClientInit = async () => {
|
||||
await Promise.all([prepareClientKeyStore(), prepareMasterKeyStore(), prepareHmacSecretStore()]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user