mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
암호 관련 모듈 리팩토링
This commit is contained in:
@@ -27,14 +27,10 @@ export const generateDataKey = async () => {
|
||||
};
|
||||
};
|
||||
|
||||
const exportAESKey = async (key: CryptoKey) => {
|
||||
return await window.crypto.subtle.exportKey("raw", key);
|
||||
};
|
||||
|
||||
export const makeAESKeyNonextractable = async (key: CryptoKey) => {
|
||||
return await window.crypto.subtle.importKey(
|
||||
"raw",
|
||||
await exportAESKey(key),
|
||||
await window.crypto.subtle.exportKey("raw", key),
|
||||
key.algorithm,
|
||||
false,
|
||||
key.usages,
|
||||
@@ -53,7 +49,7 @@ export const unwrapDataKey = async (dataKeyWrapped: string, masterKey: CryptoKey
|
||||
masterKey,
|
||||
"AES-KW",
|
||||
"AES-GCM",
|
||||
false, // Non-extractable
|
||||
false, // Nonextractable
|
||||
["encrypt", "decrypt"],
|
||||
),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user