mirror of
https://github.com/ente-io/ente.git
synced 2025-08-07 15:09:09 +00:00
Forward
This commit is contained in:
parent
22b2c49b63
commit
8ec2d3e87c
@ -1,3 +1,4 @@
|
||||
import * as ente from "@/base/crypto/ente";
|
||||
import * as libsodium from "@ente/shared/crypto/internal/libsodium";
|
||||
import * as Comlink from "comlink";
|
||||
import type { StateAddress } from "libsodium-wrappers";
|
||||
@ -31,6 +32,25 @@ export class DedicatedCryptoWorker {
|
||||
return libsodium.decryptChaCha(fileData, header, key);
|
||||
}
|
||||
|
||||
async encryptFileMetadata(
|
||||
metadata: Record<string, unknown>,
|
||||
keyB64: string,
|
||||
) {
|
||||
return ente.encryptFileMetadata(metadata, keyB64);
|
||||
}
|
||||
|
||||
async decryptFileMetadata(
|
||||
encryptedDataB64: string,
|
||||
decryptionHeaderB64: string,
|
||||
keyB64: string,
|
||||
) {
|
||||
return ente.decryptFileMetadata(
|
||||
encryptedDataB64,
|
||||
decryptionHeaderB64,
|
||||
keyB64,
|
||||
);
|
||||
}
|
||||
|
||||
async encryptMetadata(metadata: Object, key: string) {
|
||||
const encodedMetadata = textEncoder.encode(JSON.stringify(metadata));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user