BeechCMS / @beechcms/core / UnconfiguredPrivacyService
Class: UnconfiguredPrivacyService
Fail-closed IPrivacyService for installs without a master key. Never returns plaintext as protected output; legacy non-v1: values still read through.
Implements
Constructors
Constructor
new UnconfiguredPrivacyService():
UnconfiguredPrivacyService
Returns
UnconfiguredPrivacyService
Methods
decrypt()
decrypt(
ciphertext):Promise<string>
Decrypts a formatted AES-256-GCM ciphertext payload.
Parameters
ciphertext
string
The formatted ciphertext string (v1:<iv_base64>:<ciphertext_base64>).
Returns
Promise<string>
A Promise resolving to the original plaintext string.
Throws
Error if the ciphertext format is invalid or decryption fails (authentication tag mismatch).
Implementation of
encrypt()
encrypt(
_plaintext):Promise<string>
Symmetrically encrypts a plaintext string using AES-256-GCM.
Parameters
_plaintext
string
The raw string value to encrypt.
Returns
Promise<string>
A Promise resolving to formatted ciphertext (v1:<iv_base64>:<ciphertext_base64>).
Implementation of
hash()
hash(
_plaintext):Promise<string>
Computes a deterministic HMAC SHA-256 digest of a plaintext string. Used for blind-indexing and one-way field digests (restricted classification).
Parameters
_plaintext
string
The raw string value to hash.
Returns
Promise<string>
A Promise resolving to a 64-character hexadecimal digest string.