mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
* Add Helper For Preparing a Record For Use in `forkJoin` * Update & Test CryptoService Changes * Delete Unused Code * Update DeviceTrustService * Update CipherService * Make `userPublicKey$` Public * Rename convertValues File * Update libs/common/src/platform/abstractions/crypto.service.ts Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com> * Add `convertValues` Tests * Add Doc Comments * Convert to `function`'s Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com> * Fix Test Typos * Add param doc * Update Test Name * Add `@throws` Docs --------- Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
28 lines
815 B
TypeScript
28 lines
815 B
TypeScript
import { UserKey } from "../../../types/key";
|
|
import { EncryptedString } from "../../models/domain/enc-string";
|
|
import { SymmetricCryptoKey } from "../../models/domain/symmetric-crypto-key";
|
|
import { CRYPTO_DISK, CRYPTO_MEMORY, UserKeyDefinition } from "../../state";
|
|
|
|
export const USER_EVER_HAD_USER_KEY = new UserKeyDefinition<boolean>(
|
|
CRYPTO_DISK,
|
|
"everHadUserKey",
|
|
{
|
|
deserializer: (obj) => obj,
|
|
clearOn: ["logout"],
|
|
},
|
|
);
|
|
|
|
export const USER_ENCRYPTED_PRIVATE_KEY = new UserKeyDefinition<EncryptedString>(
|
|
CRYPTO_DISK,
|
|
"privateKey",
|
|
{
|
|
deserializer: (obj) => obj,
|
|
clearOn: ["logout"],
|
|
},
|
|
);
|
|
|
|
export const USER_KEY = new UserKeyDefinition<UserKey>(CRYPTO_MEMORY, "userKey", {
|
|
deserializer: (obj) => SymmetricCryptoKey.fromJSON(obj) as UserKey,
|
|
clearOn: ["logout", "lock"],
|
|
});
|