mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
파일 다운로드 임시 구현
This commit is contained in:
10
src/lib/services/file.ts
Normal file
10
src/lib/services/file.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { unwrapDataKey, decryptString } from "$lib/modules/crypto";
|
||||
import type { FileInfoResponse } from "$lib/server/schemas";
|
||||
|
||||
export const decryptFileMetadata = async (metadata: FileInfoResponse, masterKey: CryptoKey) => {
|
||||
const { dataKey } = await unwrapDataKey(metadata.dek, masterKey);
|
||||
return {
|
||||
dataKey,
|
||||
name: await decryptString(metadata.name, metadata.nameIv, dataKey),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user