mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 15:08:46 +00:00
암호 키 생성 및 등록시 최초 MEK도 함께 생성 및 등록하도록 구현
This commit is contained in:
@@ -9,8 +9,9 @@
|
||||
import {
|
||||
createBlobFromKeyPairBase64,
|
||||
requestPubKeyRegistration,
|
||||
requestTokenUpgrade,
|
||||
storeKeyPairPersistently,
|
||||
requestTokenUpgrade,
|
||||
requestInitialMekRegistration,
|
||||
} from "./service";
|
||||
|
||||
import IconKey from "~icons/material-symbols/key";
|
||||
@@ -39,16 +40,22 @@
|
||||
isBeforeContinueModalOpen = false;
|
||||
isBeforeContinueBottomSheetOpen = false;
|
||||
|
||||
if (await requestPubKeyRegistration(data.pubKeyBase64, $keyPairStore.privateKey)) {
|
||||
try {
|
||||
if (!(await requestPubKeyRegistration(data.pubKeyBase64, $keyPairStore.privateKey)))
|
||||
throw new Error("Failed to register public key");
|
||||
|
||||
await storeKeyPairPersistently($keyPairStore);
|
||||
|
||||
if (await requestTokenUpgrade(data.pubKeyBase64)) {
|
||||
await goto(data.redirectPath);
|
||||
} else {
|
||||
// TODO: Error handling
|
||||
}
|
||||
} else {
|
||||
if (!(await requestTokenUpgrade(data.pubKeyBase64)))
|
||||
throw new Error("Failed to upgrade token");
|
||||
|
||||
if (!(await requestInitialMekRegistration(data.mekDraft, $keyPairStore.publicKey)))
|
||||
throw new Error("Failed to register initial MEK");
|
||||
|
||||
await goto(data.redirectPath);
|
||||
} catch (e) {
|
||||
// TODO: Error handling
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user