mirror of
https://github.com/docmost/docmost.git
synced 2026-08-25 05:21:07 +08:00
Provides an injectable EncryptionService that encrypts/decrypts strings with AES-256-GCM using a key derived from APP_SECRET with domain separation.
14 lines
372 B
TypeScript
14 lines
372 B
TypeScript
export class UnableToInitialize extends Error {
|
|
constructor(message: string) {
|
|
super(`Unable to initialize the encryption service: ${message}`);
|
|
this.name = 'UnableToInitialize';
|
|
}
|
|
}
|
|
|
|
export class UnableToDecrypt extends Error {
|
|
constructor(reason: string) {
|
|
super(`Unable to decrypt the ciphertext: ${reason}`);
|
|
this.name = 'UnableToDecrypt';
|
|
}
|
|
}
|